220-1102 Question 268
Single answerCommon configuration filesA Linux workstation was recently updated, and now a user reports that the system no longer resolves hostnames for internal servers unless they use full IP addresses. The NIC has a valid IP address and can ping external public IPs, but DNS lookups fail. You need to verify which configuration file should contain the DNS server entries for the system. Which file should you check first?
- A
/etc/hosts
- B
/etc/resolv.conf
- C
/etc/fstab
- D
/var/log/syslog
Show answer and explanation
Correct answer: B
Explanation
The best answer is /etc/resolv.conf because it is the traditional Linux resolver configuration file used to specify DNS servers with nameserver entries. In a real troubleshooting scenario, if a host has network connectivity by IP address but cannot resolve hostnames, the issue often points to DNS configuration rather than basic connectivity. While modern distributions may generate /etc/resolv.conf dynamically through NetworkManager, systemd-resolved, or DHCP, it is still the correct file to inspect first when verifying what DNS servers the system is currently using. By contrast, /etc/hosts only provides local static name mappings, /etc/fstab manages mounted filesystems, and /var/log/syslog is for reviewing events rather than storing resolver settings. This aligns with standard Linux administration practices and resolver configuration documented in Linux manual pages such as resolv.conf(5).
- A. Incorrect.
/etc/hosts is used for static hostname-to-IP mappings on the local system. While an incorrect entry here can affect name resolution for specific hosts, it is not the primary file that stores the system's DNS server settings. A technician might choose this option because it is related to hostname resolution, but it does not typically define which DNS servers the system queries.
- B. Correct.
/etc/resolv.conf is the standard Linux configuration file that contains DNS resolver settings, including nameserver entries, search domains, and resolver behavior. If the system can reach external IP addresses but cannot resolve names, checking this file first is the most appropriate step to confirm that valid DNS servers are configured.
- C. Incorrect.
/etc/fstab is the filesystem table used to define how disks, partitions, and network filesystems are mounted at boot or on demand. It has no role in DNS server configuration. This distractor is plausible because it is a common Linux configuration file, but it applies to storage and mounting rather than networking.
- D. Incorrect.
/var/log/syslog is a general system log file on many Linux distributions and may contain messages related to networking or DNS services. However, it is not the configuration file that stores DNS server entries. A technician might review logs later for troubleshooting, but it is not the first file to check for resolver configuration.