Networking 9
DNS and name resolution on Linux servers: find which resolver fails and why, with dig and resolvectl output.
- dig ad and cd flags: why +cd still shows ad, even on REFUSED
dig's ad flag marks a DNSSEC-validated answer; cd asks to skip validation. ad shows up with +cd and on REFUSED, vanishes with +noadflag: read status and EDE.
Ubuntu 24.04 · BIND 9.18.39 · Unbound 1.19.2 · DiG 9.18.39 (Docker) · 2026-10 - Fix port 53 Address already in use (systemd-resolved, dnsmasq)
Port 53 Address already in use from dnsmasq or Pi-hole usually means the systemd-resolved stub holds 127.0.0.53. Bind a specific address or disable the stub.
Ubuntu 24.04 (Docker) · systemd 255 systemd-resolved · dnsmasq 2.91 · 2026-10 - dig status: SERVFAIL? Use +cd to Check for a DNSSEC Failure
When dig returns status: SERVFAIL, repeat the query with +cd. NOERROR means DNSSEC validation failed; read the EDE line and compare DS and DNSKEY key tags.
Ubuntu 24.04 · BIND 9.18.39 dig/delv (Docker) · public resolvers 1.1.1.1, 8.8.8.8 · 2026-10 - Unbound SERVFAIL with no EDE: lame delegation or REFUSED upstream
Unbound SERVFAIL with no EDE doesn't name the cause. Here (ede: yes) the delegated NS said REFUSED. Compare with +cd, then query the NS listed at the parent.
Ubuntu 24.04 · BIND 9.18.39 · Unbound 1.19.2 · DiG 9.18.39 (Docker) · 2026-10 - Flush DNS Cache on Linux: resolvectl flush-caches and More
To flush DNS cache on Linux, find what caches first. On Ubuntu it's systemd-resolved: sudo resolvectl flush-caches. Flush dnsmasq, nscd and browsers separately.
Ubuntu 24.04 (Docker) · systemd 255 systemd-resolved · dnsmasq 2.91 · 2026-10 - dig +short shows a CNAME but status is NXDOMAIN (dangling CNAME)
dig +short prints only a CNAME? Drop +short and read status. NXDOMAIN: the target is missing, so create it or fix the CNAME. NOERROR: NODATA.
Ubuntu 24.04 · BIND 9.18.39 · Unbound 1.19.2 · DiG 9.18.39 (Docker) · 2026-10 - Fix Temporary failure in name resolution on Linux
Temporary failure in name resolution means the DNS server in resolv.conf did not answer. Query it with dig to tell a resolver fault from a network fault.
Ubuntu 24.04 (Docker) · iputils 20240117 · DiG 9.18.39 · 2026-10 - dig status: REFUSED — Fix Recursion Denied and Not Authoritative
dig status: REFUSED means the server declined by policy. You asked an authoritative-only server about another zone, or you're outside the resolver's ACL.
Ubuntu 24.04 · BIND 9.18.39 · Unbound 1.19.2 (Docker) · 2026-10 - New DNS Record Not Resolving? NXDOMAIN Negative Caching
New DNS record still NXDOMAIN? Ask the authoritative server with dig +norecurse. If it's there, the resolver cached the NXDOMAIN; wait out the SOA TTL.
Ubuntu 24.04 · BIND 9.18.39 · Unbound 1.19.2 · DiG 9.18.39 (Docker) · 2026-10