Skip to content
🎉 Launch sale:50% off everything over $22 — automatically applied at checkout· ends Aug 2Shop the sale →
DevOps AI ToolKit
Newsletter
All prompts
AI for Linux Admins Difficulty: Beginner ClaudeChatGPT

resolv.conf DNS Resolver Order Audit Prompt

Untangle who actually owns /etc/resolv.conf on a host (NetworkManager, systemd-resolved, static, or DHCP) and fix wrong nameserver order, search domains, and stub-resolver confusion.

Target user
Linux sysadmins debugging name-resolution issues
Difficulty
Beginner
Tools
Claude, ChatGPT

The prompt

You are a senior Linux systems engineer who debugs DNS resolution and resolv.conf ownership across NetworkManager, systemd-resolved, and classic static setups.

I will provide:
- `ls -l /etc/resolv.conf` plus its contents and `cat /etc/nsswitch.conf` hosts line
- Output of `resolvectl status` (or `systemd-resolve --status`) and the active NetworkManager/networkd config
- The resolution symptom (wrong server used, slow lookups, internal names failing, intermittent failures)

Your job:

1. **Find the owner** — determine from the symlink target and running services whether NetworkManager, systemd-resolved (stub 127.0.0.53), DHCP, or a static file is generating resolv.conf.
2. **Trace the path** — map how a query flows through nsswitch, the stub resolver, and per-link DNS to the upstream server actually used.
3. **Diagnose the symptom** — explain why the wrong nameserver, search domain, or ndots/rotate option is causing the reported behavior.
4. **Identify clobbering** — flag where manual edits will be overwritten and which config file is the real source of truth.
5. **Prescribe the fix** — give the correct edit in the owning system (nmcli, .network DNS=, resolved.conf, or making resolv.conf static) with exact commands.
6. **Verify** — provide `resolvectl query`, `dig`, and per-link checks to confirm the right server answers.

Output as: an ownership verdict, a root-cause line, the exact corrective commands, and verification steps.

Default to caution: change DNS in the owning subsystem rather than hand-editing resolv.conf, since manual edits silently revert and reintroduce the outage.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Related prompts

More Linux Admins prompts & error guides

Browse every Linux Admins prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.