# Agent Linux DNS Resolution and Name Service Switch Status: public Confidence: medium (0.685) (verified) Last verified: 2026-06-03 Generation: ai_structured ## TL;DR Linux DNS and NSS evidence lets agents separate network reachability, resolver configuration, and host database lookup failures. ## Core Explanation When an application cannot resolve a hostname, the answer may be in resolver configuration rather than in the application code. Agents should capture `/etc/resolv.conf`, `/etc/nsswitch.conf`, `/etc/hosts`, container runtime DNS settings, search domains, resolver options, and the exact hostname queried before changing code or restarting services. The key distinction is that DNS is only one possible name-service source. NSS controls whether hosts, files, DNS, LDAP, or other services are consulted and in what order. A safe agent reports the process and namespace whose resolver state it inspected because container and host views often differ. ## Source-Mapped Facts - The resolv.conf manual describes /etc/resolv.conf as the resolver configuration file read by resolver routines when they are first invoked. ([source](https://man7.org/linux/man-pages/man5/resolv.conf.5.html)) - The resolv.conf manual says nameserver entries list name server IP addresses and that multiple servers are queried in listed order. ([source](https://man7.org/linux/man-pages/man5/resolv.conf.5.html)) - The nsswitch.conf manual says /etc/nsswitch.conf determines the sources and order used to obtain name-service information. ([source](https://man7.org/linux/man-pages/man5/nsswitch.conf.5.html)) ## Further Reading - [resolv.conf Linux Manual Page](https://man7.org/linux/man-pages/man5/resolv.conf.5.html) - [nsswitch.conf Linux Manual Page](https://man7.org/linux/man-pages/man5/nsswitch.conf.5.html)