nerdexam
CompTIACompTIA

XK0-005 · Question #202

XK0-005 Question #202: Real Exam Question with Answer & Explanation

The correct answer is C: echo "192.168.204.11 Payroll" >> /etc/hosts. To configure local hostname resolution without using DNS, a specific system file must be modified to map IP addresses to hostnames.

System Management

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

Explanation

To configure local hostname resolution without using DNS, a specific system file must be modified to map IP addresses to hostnames.

Common mistakes.

  • A. /etc/resolv.conf is used to configure DNS nameservers, which contradicts the requirement to avoid DNS.
  • B. /etc/sysctl.conf is used for kernel runtime parameters and has no function in local hostname resolution.
  • D. /etc/network/interface (or similar files) configures network interfaces, not local hostname mappings, and the provided syntax is incorrect for this purpose.

Concept tested. Local hostname resolution using /etc/hosts

Reference. https://linux.die.net/man/5/hosts

Topics

#hostname resolution#/etc/hosts#network configuration#Linux file system

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions