A system administrator observes that a server is resolving webapp.local to an outdated IP address found in /etc/hosts, even though the correct IP address exists in the corporate DNS. To ensure the system always prioritizes DNS for all hostname lookups and only uses the local file as a fallback, which line must be configured in /etc/nsswitch.conf?
The correct answer is hosts: dns files. The /etc/nsswitch.conf file dictates the order in which the system consults various sources for name service information. The hosts database entry specifically controls the lookup order for hostname-to-IP address resolution. The keyword dns refers to the Domain Name System, while files refers to the local /etc/hosts file. By placing dns before files, the system is instructed to query DNS first. If the hostname is not found via DNS, it then proceeds to check the /etc/hosts file. The entry hosts: files dns is the common default that causes the problem described in the scenario. nameserver: dns files is incorrect because nameserver is not a valid database in nsswitch.conf; it is a directive used in /etc/resolv.conf. The entry hosts: dns /etc/hosts is also incorrect because nsswitch.conf requires the keyword files, not the full path to the file.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the /etc/nsswitch.conf file?
Open an interactive chat with Bash
What is the difference between entries like 'files' and 'dns' in /etc/nsswitch.conf?
Open an interactive chat with Bash
How does /etc/resolv.conf differ from /etc/nsswitch.conf?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
System Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access