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
- PlatformsUbuntu 26.04 LTS + AlmaLinux 10.2
- LVM2.03.31 (Ubuntu) / 2.03.36 (AlmaLinux)
- nftables1.1.6 (Ubuntu) / 1.1.5 (AlmaLinux)
- TimeAbout 16 min
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.
- Firewallufw 0.36.2 enabled but reporting inactive / firewalld active
- Network confignetplan + systemd-networkd / NetworkManager 1.56.0
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| LFCS-A01 | 192.168.0.70 | Ubuntu 26.04 LTS | Primary host - most guides run only here | 2 Core | 4 GB | 50 GB |
| LFCS-C01 | 192.168.0.72 | AlmaLinux 10.2 | The other distribution - dnf, firewalld and NetworkManager | 2 Core | 4 GB | 50 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.
- finding the one line that decides the order
- telling the two very different resolv.conf files apart
- asking systemd-resolved what it is really using
- asking the same name three ways, and getting three different answers
- watching /etc/hosts win invisibly, and an answer outlive the file
Before you start
- guide 23 - where the nameservers came from.
-
The line that decides the order
-
Two very different resolv.conf files
-
What resolved is really using
-
Asking the same name three ways
-
/etc/hosts wins, and dig cannot see it
-
The answer that outlived the file