CertGrid CertGrid
Hands-on Lab·Linux Foundation Certified System Administrator

Name resolution, end to end

Half of all "the network is down" reports are name resolution, and the tools people reach for answer different questions. This guide follows a name through nsswitch, /etc/hosts and the stub resolver, shows why dig can say a name does not exist while programs resolve it fine, and catches a cached answer surviving the file that created it.

Networking Guide 24 of 38 Intermediate

Ubuntu 26.04 runs systemd-resolved with /etc/resolv.conf a symlink to the stub file listing 127.0.0.53. RHEL 10 has a plain /etc/resolv.conf naming the real servers. Both read /etc/nsswitch.conf first.

Ubuntu leads every step because it is what LFCS is most likely to hand you; RHEL follows so the difference is visible rather than described.
Server NameIP AddressOSRolesCPURAMHDD
LFCS-A01192.168.0.70Ubuntu 26.04 LTSPrimary host - most guides run only here2 Core4 GB50 GB
LFCS-C01192.168.0.72AlmaLinux 10.2The other distribution - dnf, firewalld and NetworkManager2 Core4 GB50 GB

This guide includes

Use this because half of all "the network is down" reports are name resolution. This matters because /etc/hosts wins and dig cannot see it - so the first tool you reach for is the one that will not show you the answer.

Before you start

  1. The line that decides the order

  2. Two very different resolv.conf files

  3. What resolved is really using

  4. Asking the same name three ways

  5. /etc/hosts wins, and dig cannot see it

  6. The answer that outlived the file

Official sources