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
-
systemd-resolved DNS Resolution Debugging Prompt
Diagnose Linux DNS resolution failures driven by systemd-resolved — split-DNS, stub resolver, /etc/resolv.conf symlinks, search domains, and DNSSEC/caching quirks on Ubuntu and friends.
-
Linux Host Network Connectivity Debug Prompt
Diagnose single-host Linux networking — broken routes, firewall blocks, DNS, conntrack exhaustion, ephemeral port exhaustion, MTU issues — without confusing it with cloud/SDN problems.
-
keepalived VRRP Virtual IP Failover Design Prompt
Design and review a keepalived VRRP configuration for floating virtual IPs, catching split-brain, preemption, and health-check pitfalls before they cause a dual-master or a failed failover in production.
-
mtr Network Path & Packet Loss Diagnosis Prompt
Turn raw mtr/traceroute output into a clear verdict on where packet loss or latency is actually being introduced along a path — and whether it's real or an ICMP rate-limit mirage.
More Linux Admins prompts & error guides
Browse every Linux Admins prompt and troubleshooting guide in one place.
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.