XK0-004 · Question #202
Users in the payroll department are not configured to use DNS due to security concerns. The users ask the junior Linux administrator to configure their workstations to access the payroll server at…
The correct answer is C. echo "192.168.204.11 Payroll" >> /etc/hosts. The /etc/hosts file provides static hostname-to-IP mappings that work without DNS. Appending '192.168.204.11 Payroll' to this file allows the workstation to resolve the name 'Payroll' locally.
Question
Users in the payroll department are not configured to use DNS due to security concerns. The users ask the junior Linux administrator to configure their workstations to access the payroll server at 192.168.204.11 by the name "Payroll". Which of the following commands should the administrator issue to meet this request?
Options
- Aecho "nameserver 192.168.204.11 #Payroll" >> /etc/resolv.conf
- Becho "net.ipv4.ip_dynaddr=192.168.204.11 Payroll" >> /etc/sysctl.conf
- Cecho "192.168.204.11 Payroll" >> /etc/hosts
- Decho `IPADDR="192.168.204.11" #Payroll' >> /etc/network/interface
How the community answered
(33 responses)- A3% (1)
- C94% (31)
- D3% (1)
Why each option
The /etc/hosts file provides static hostname-to-IP mappings that work without DNS. Appending '192.168.204.11 Payroll' to this file allows the workstation to resolve the name 'Payroll' locally.
/etc/resolv.conf is used to configure DNS nameserver addresses and search domains, not to create static hostname-to-IP mappings.
/etc/sysctl.conf is used to set kernel runtime parameters and has no role in hostname or IP address name resolution.
The /etc/hosts file is a local static lookup table that maps hostnames to IP addresses without requiring DNS resolution. Appending '192.168.204.11 Payroll' to this file allows the system to resolve 'Payroll' to the specified IP address entirely locally, satisfying the security requirement of not using DNS.
/etc/network/interfaces is used to configure network interface settings such as IP assignment, not for static hostname resolution.
Concept tested: Static hostname resolution using /etc/hosts
Source: https://man7.org/linux/man-pages/man5/hosts.5.html
Topics
Community Discussion
No community discussion yet for this question.