Name Switch: The Host Table Nobody Was Reading
MediumNetworking15-25 minThis host stopped resolving its internal names — vault, registry, git on the site domain — while public names like example.com still resolve fine. The confusing part: the internal names are right there in /etc/hosts with correct addresses, and DNS is healthy, yet getent hosts returns nothing for them.
When the host table is correct and DNS is up but a name still won't resolve, the fault is usually the layer that decides which sources glibc consults for host lookups, and in what order: the Name Service Switch, /etc/nsswitch.conf. If its hosts: line doesn't list the local files source, /etc/hosts is never read, no matter what it contains.
Do two things. First, record the root cause — which file and line is actually misconfigured — to /root/case/finding.txt. Second, repair host-name resolution so the internal names resolve from /etc/hosts again while public names keep resolving via DNS, with the local files source consulted ahead of dns so an internal entry can never be shadowed by a public DNS answer for the same name. Verify with getent hosts <name>, the same path applications use. See /root/case/brief.txt. Grading reads /etc/nsswitch.conf and your finding.
- Distinguish an NSS lookup-order fault from a host-table or resolver fault
- Identify /etc/nsswitch.conf's hosts: line as the misconfiguration
- Restore the files source so /etc/hosts is consulted again
- Order files ahead of dns so local entries stay authoritative
Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.
