Pcornel
Linux · Linux Troubleshooting

DNS Failure

Cheat sheet · https://pcornel.dk/topic.php?topic=2918

Back to the Topic

Answer

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

Remember

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.

First 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

Commands

resolvectl query <name>
Tests the systemd-resolved resolution path.
resolvectl flush-caches
getent hosts name
resolvectl status
resolvectl query name
dig @10.20.0.53 name
dig +trace name
dig @<auth-ns> name
dig
resolvectl query
resolvectl
getent
resolvectl domain

Verify in this order

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

Where it usually breaks

First mismatch in persistent intent → provider/parser/generator → kernel/userspace runtime → dependency/security context → logs/counters → consumer-visible read-back; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2918

Confirmation

Confirm action

Continue?