GSLC · Question #108
Which of the following files must be configured to enable hostname lookups to use the Domain Name Service (DNS)?
The correct answer is C. /etc/nsswitch.conf. /etc/nsswitch.conf is the Linux Name Service Switch configuration file that must be edited to include 'dns' as a source for hostname lookups.
Question
Which of the following files must be configured to enable hostname lookups to use the Domain Name Service (DNS)?
Options
- Alibnss_ldap
- B/etc/pam.d
- C/etc/nsswitch.conf
- D/etc/pam.d/sshd
How the community answered
(36 responses)- A3% (1)
- B3% (1)
- C89% (32)
- D6% (2)
Why each option
/etc/nsswitch.conf is the Linux Name Service Switch configuration file that must be edited to include 'dns' as a source for hostname lookups.
libnss_ldap is a shared library that enables LDAP-backed name service queries; it is not a configuration file that activates DNS hostname resolution.
/etc/pam.d is a directory containing PAM (Pluggable Authentication Modules) configuration files for user authentication and has no role in hostname or DNS resolution.
/etc/nsswitch.conf controls which databases and resolvers the system consults, and in what order, for various lookups including hostname resolution. To enable DNS, the 'hosts' entry in this file must list 'dns' as a source (e.g., 'hosts: files dns'). Without this configuration, the system will not forward unresolved hostnames to a DNS server regardless of other DNS settings.
/etc/pam.d/sshd configures PAM authentication specifically for the SSH daemon and does not influence how the system resolves hostnames via DNS.
Concept tested: Linux nsswitch.conf configuration for DNS resolution
Source: https://man7.org/linux/man-pages/man5/nsswitch.conf.5.html
Topics
Community Discussion
No community discussion yet for this question.