Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

DNS Failure

Direct answer

A DNS failure means names do not resolve (or resolve wrongly) while IP connectivity works.

When to use this

Use it when ping <ip> works but ping <name> fails, or applications cannot find hosts.

First 30 seconds

1. getent hosts <name> — resolves through the system path?

2. resolvectl status / cat /etc/resolv.conf — which servers?

3. dig <name> @<server> — answers?

4. grep hosts /etc/nsswitch.conf and /etc/hosts — override?

5. Fix the resolver config and test again.

Operational verification

application → nsswitch (files, dns) → stub resolver → DNS server → answer

Evidence · next step

For Linux Troubleshooting → DNS Failure, continue with the first unproven Topic check: Reproduce the exact name/query from the affected application or equivalent libc resolver path. If that boundary is healthy, advance to the adjacent check: Inspect nsswitch, resolv.conf ownership/stub configuration, search domains and effective resolver service/cache. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Key commandresolvectl query <name>
Scope / prerequisiteUse it when ping works but ping fails, or applications cannot find hosts.
Reference · 1
What next?3 suggested next steps
Catalog command links1
Evidence1
On this pageJump to a specific section
Linux command reference

Primary Commands

Configuration and operational commands for this Topic.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

10 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

Healthy evidence: fresh application-path resolution returns the intended answer through the effective resolver configuration and the original workload succeeds without relying on stale cache.

Step 2 Command read-back and what it shows Verify boundary

Known-good is the query returns the expected record/address from the intended resolver path without validation error, repeated uncached/controlled tests are consistent and the original application lookup/service request succeeds; broken state is timeout, no suitable DNS server, NXDOMAIN/SERVFAIL for a known valid name, wrong/stale address or successful CLI lookup with persistent application-specific resolution failure. resolvectl query shows systemd-resolved's result for that name/query context only, but it does not show every application uses the same resolver path or that the resolved service is reachable.

Step 3 Known-good, broken and when it is fixed Verify boundary

Verification for Linux Troubleshooting → DNS Failure must discriminate known-good from broken/suspicious state. With resolvectl query <name>, known-good is: the intended name resolves to expected records through the expected resolver/link. Broken/suspicious is: timeout, SERVFAIL/NXDOMAIN, wrong resolver/link or unexpected records identify a client/DNS boundary. Read back the same target after the minimal approved change, then inspect resolvectl status, routing/connectivity to the chosen DNS server and compare an authoritative lookup before editing resolver config.

Step 4 Commands Verify boundary
resolvectl query host
dig host
cat /etc/resolv.conf
Step 5 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Reproduce the exact name/query from the affected application or equivalent libc resolver path.

  • Inspect nsswitch, resolv.conf ownership/stub configuration, search domains and effective resolver service/cache.
  • Query the configured resolver and compare response code/answer/TTL with authoritative expectations and transport reachability.
  • Flush/retry only when justified, then repeat the original application transaction using the intended resolver path.
Step 6 Failure modes and next checks Narrow the fault

Suspicious evidence: only dig to 8.8.8.8 is tested, IP connectivity is assumed to show resolver reachability, split DNS/search suffixes are ignored, or cached success hides current authoritative failure.

Step 7 Observation-driven branch and next-check logic Narrow the fault

If resolvectl query returns timeout/no servers, inspect per-link DNS/routing/firewall; if it returns NXDOMAIN/SERVFAIL, compare name/search-domain and upstream/authoritative behavior; if it returns an address but application fails, inspect application resolver context, IPv4/IPv6 choice and the target service.

Step 8 Observation-driven troubleshooting tree Narrow the fault

Troubleshoot Linux Troubleshooting → DNS Failure from one exact failing target, revision/input and timestamp. Capture resolvectl query <name> before mutation, then branch by the first divergent observation: literal IP connectivity also fails, troubleshoot networking before DNS; resolvectl lacks an appropriate server/link, fix resolver source/configuration; query times out, inspect route/firewall/server reachability and UDP-vs-TCP behavior; NXDOMAIN/SERVFAIL/validation failure arrives, distinguish authoritative absence, upstream recursion and DNSSEC; resolvectl query succeeds while the application fails, compare NSS, search-name expansion, container namespace, proxy/VPN and application-specific resolver/cache. Typical failure signatures include stale or wrong resolv.conf, dead local stub, VPN replacing routing domains, unreachable DNS server, firewall blocking UDP/TCP 53, EDNS/MTU issue, DNSSEC clock/validation failure, split-horizon answer from the wrong link, bad search suffix, stale negative cache or application using a custom resolver that disagrees with systemd-resolved.

Step 9 Failure signatures, dependencies and operational guardrails Narrow the fault

Failure-signature and guardrail reference for Linux Troubleshooting → DNS Failure: Stale or wrong resolv.conf, dead local stub, VPN replacing routing domains, unreachable DNS server, firewall blocking UDP/TCP 53, EDNS/MTU issue, DNSSEC clock/validation failure, split-horizon answer from the wrong link, bad search suffix, stale negative cache or application using a custom resolver that disagrees with systemd-resolved. Operational guardrail: resolvectl query <name> shows the systemd-resolved path for that exact name, link/routing-domain selection and returned result at that moment, but it does not show a container, browser, JVM or other custom resolver uses the same path. Verify the exact application lookup after the minimal change, then a known-good name and direct IP/network path to separate DNS recovery from broader connectivity. Dependencies that can mimic the same symptom are NSS configuration, resolv.conf symlink/content, systemd-resolved service and per-link state, DHCP/VPN-provided DNS, routing and firewall for port 53 or encrypted DNS, MTU, DNSSEC/time, search suffixes, split-DNS routing domains, recursive resolver health and authoritative zone correctness.

Step 10 Common mistakes Narrow the fault
  • Testing only with ping.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

Check which resolver the system uses (systemd-resolved stub 127.0.0.53 or /etc/resolv.conf), then whether that server answers. /etc/hosts and nsswitch.conf can override DNS.

Key checks
  • journalctl -b -p err — errors this boot
  • systemctl --failed — failed units
  • df -h; df -i — space and inodes
  • ss -tulpn — listening sockets
  • dmesg -T | tail — recent kernel messages
ReferenceWhat it is1 section · depth on demand

Core model

Use the same hostname, query type and application context. Compare libc/NSS resolution with direct DNS queries, identify the effective resolver path and configuration, then trace client cache/stub, network transport, recursive server and authoritative answer.

ReferenceHow it works2 sections · depth on demand

How it works

DNS Failure is governed by application resolver request, NSS/systemd-resolved policy/cache, configured DNS server reachability and authoritative/recursive DNS data. A Linux name lookup passes through NSS/resolver configuration, may use systemd-resolved per-link routing/cache, then queries recursive DNS servers that resolve authoritative data; local resolver state and upstream DNS correctness are separate stages. Network routing, firewall, DHCP/VPN-provided DNS, search domains, DNSSEC and authoritative zone state are distinct boundaries. The important state separation is that IP connectivity can be healthy while DNS fails, and one successful cached lookup does not show the configured upstream server or authoritative data is currently correct.

Execution mechanics in detail

Linux Troubleshooting → DNS Failure owns application resolver choice, libc/NSS ordering, /etc/resolv.conf or systemd-resolved stub linkage, per-link DNS servers and routing/search domains, cache and DNSSEC state, transport to the selected recursive resolver, upstream recursion/authoritative response and any split-horizon policy that determines the returned answer. Execution mechanics: A Linux name lookup begins in an application that may use libc/NSS, systemd-resolved or its own resolver; NSS selects a source, the local resolver chooses a per-link or global DNS server and routing domain, sends UDP/TCP or configured encrypted DNS transport, validates/caches the result and returns records to the application; a successful manual query can bypass the exact path used by the failing application. Keep adjacent dependencies separate: NSS configuration, resolv.conf symlink/content, systemd-resolved service and per-link state, DHCP/VPN-provided DNS, routing and firewall for port 53 or encrypted DNS, MTU, DNSSEC/time, search suffixes, split-DNS routing domains, recursive resolver health and authoritative zone correctness. The mapped read surface resolvectl query <name> exposes resolver-selected DNS server/link plus returned records or resolution error for the queried name.

ReferenceImportant terms & boundaries4 sections · depth on demand

What this shows and what it does not

DNS Failure owns Linux host-side DNS fault isolation; DNS-specific protocol depth and Linux Networking own resolver infrastructure and transport layers.

In depth

Troubleshooting name resolution

DNS problems look like everything else: "the site is down", "the database is unreachable", slow logins. Testing each layer separately shows where the problem lies. On systems with systemd-resolved, the systemd-resolved.service(8) manual page explains the parts that often cause surprises:

  • Applications talk to the local stub at 127.0.0.53.
  • Each link can have its own DNS servers and routing domains. The longest matching domain wins, and ~. makes a link the default.
  • /etc/resolv.conf can be in one of four modes.
  • resolvectl flush-caches clears the cache.

Layer by layer

LayerTestIf it fails
1. What applications getgetent hosts nameContinue below
2. /etc/hostsgrep name /etc/hostsA stale override
3. Resolver configurationresolvectl status; cat /etc/resolv.confWrong servers or search domains
4. Through the local resolverresolvectl query nameresolved, or its upstream servers
5. Each upstream server directlydig @10.20.0.53 nameThat server, or the network path to it
6. The authoritative answerdig +trace name, or dig @<auth-ns> nameZone data or delegation

Common causes

SymptomLikely cause
Works with dig, fails in applications/etc/hosts, nsswitch order, or search domain handling
Internal names fail over the VPNMissing routing domain for the VPN link
Lookups take exactly 5 or 2 s, then workThe first nameserver doesn't answer (the timeout)
Some clients see the old addressCaches or TTLs; the DNS change hasn't expired everywhere
SERVFAIL for a domainDNSSEC validation failure, or broken delegation
NXDOMAIN for a name that existsWrong view or zone; a typo in the search domain
host$ getent hosts intranet.corp.example.net || echo "no answer"
no answer
host$ resolvectl status | grep -E "Link|Current DNS|DNS Domain"
Link 2 (eth0)
Current DNS Server: 10.20.0.53
       DNS Domain: example.net
Link 5 (wg0)
Current DNS Server: 10.99.0.53
host$ dig @10.99.0.53 +short intranet.corp.example.net
10.99.12.20
host$ sudo resolvectl domain wg0 '~corp.example.net'
host$ resolvectl query intranet.corp.example.net
intranet.corp.example.net: 10.99.12.20 -- link: wg0

Reading the example

The VPN's DNS server knows the name, but the VPN link had no routing domain. Queries for corp.example.net went to the office server on eth0, which doesn't. Adding ~corp.example.net to wg0 routes those queries correctly. Make it permanent in the VPN or network configuration.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

DNS Failure is part of Linux Troubleshooting → DNS Failure. DNS Failure separates application resolver behavior, nsswitch/systemd-resolved or local resolver state, configured nameservers/search domains, transport reachability and authoritative DNS response correctness.

Topic-specific state model. DNS Failure separates application resolver behavior, nsswitch/systemd-resolved or local resolver state, configured nameservers/search domains, transport reachability and authoritative DNS response correctness.

Interpretation rule. - Ping by IP works ≠ DNS is the only remaining problem.

  • dig to a chosen server works ≠ the application resolver path works.
  • nameserver configured ≠ it is reachable or returning correct data.
  • One successful cached lookup ≠ fresh uncached resolution is healthy.

Method

DNS resolution failure:

resolvectl status                     # systemd-resolved: per-link DNS servers
cat /etc/resolv.conf
getent hosts app.example.com          # uses NSS (hosts file, resolved, etc.)
dig app.example.com @10.0.0.53 +short
dig +trace example.com
grep hosts /etc/nsswitch.conf

dig bypasses NSS and the hosts file, getent follows the same path as applications — compare both. With systemd-resolved, /etc/resolv.conf points to 127.0.0.53 (stub); the real servers are in resolvectl. Split DNS on VPNs needs per-link routing domains (resolvectl domain).

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. DNS Failure owns Linux host-side DNS fault isolation; DNS-specific protocol depth and Linux Networking own resolver infrastructure and transport layers.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in Linux Troubleshooting → DNS Failure. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.kernel.org/ · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
linux dns failurelinux name resolution problemresolv.conf troubleshootingsystemd resolved dns
Embedded reference data

Quick lookup tables

DNS Failure operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for DNS Failure.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateDNS Failure separates application resolver behavior, nsswitch/systemd-resolved or local resolver state, configured nameservers/search domains, transport reachability and authoritative DNS response correctness.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin symptom + exact time + host/boot/user → define scope + expected baseline → preserve original failing test → collect targeted kernel/process/service/storage/network/security/log evidence → identify first divergent boundary → make one minimal reversible change → repeat original test → verify adjacent regressions and retain before/after evidence.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainsymptom + exact time → scope + baseline → reproduce original failure → collect first-party evidence → identify first failed boundary → minimal controlled change → repeat original test → regression/posture checkTrace requested/configured state through effective state to the observed workload result.
Failure boundaryDNS Failure troubleshooting is complete only when evidence localizes the first failed Linux boundary and the original failing workload passes after the smallest justified change; intermediate command success is not final proof.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux troubleshooting evidence can establish this proof path: symptom + exact time → scope + baseline → reproduce original failure → collect first-party evidence → identify first failed boundary → minimal controlled change → repeat original test → regression/posture checkUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove behavior outside the captured host, boot, process/user, dependency, time or workload scope. DNS Failure troubleshooting is complete only when evidence localizes the first failed Linux boundary and the original failing workload passes after the smallest justified change; intermediate command success is not final proof.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven boundary: reproduce the exact original failure, collect the owning subsystem evidence at the same time, change only the proven cause or prerequisite, then repeat the original workload and regression checks.Continue to the next unresolved boundary while preserving the original test condition.

DNS Failure · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryDNS Failure
Topic pathLinux Troubleshooting → DNS Failure
Runtime stateDNS Failure separates application resolver behavior, nsswitch/systemd-resolved or local resolver state, configured nameservers/search domains, transport reachability and authoritative DNS response correctness.
Fast checks- Reproduce the exact name/query from the affected application or equivalent libc resolver path. - Inspect nsswitch, resolv.conf ownership/stub configuration, search domains and effective resolver service/cache. - Query the configured resolver and compare response code/answer/TTL with authoritative expectations and transport reachability. - Flush/retry only when justified, then repeat the original application transaction using the intended resolver path.
Verification chainsymptom + exact time → scope + baseline → reproduce original failure → collect first-party evidence → identify first failed boundary → minimal controlled change → repeat original test → regression/posture check Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary.
Failure boundaryDNS Failure troubleshooting is complete only when evidence localizes the first failed Linux boundary and the original failing workload passes after the smallest justified change; intermediate command success is not final proof. Boundary chain: process/socket namespace → source/rule/FIB → neighbor → netfilter/eBPF/qdisc → virtual/physical device → peer → return → application.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?