nerdexam
CompTIA

XK0-005 · 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. 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

How the community answered

(48 responses)
  • A
    4% (2)
  • B
    6% (3)
  • C
    73% (35)
  • D
    17% (8)

Why each option

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

Aecho "nameserver 192.168.204.11 #Payroll" >> /etc/resolv.conf

`/etc/resolv.conf` is used to configure DNS nameservers, which contradicts the requirement to avoid DNS.

Becho "net.ipv4.ip_dynaddr=192.168.204.11 Payroll" >> /etc/sysctl.conf

`/etc/sysctl.conf` is used for kernel runtime parameters and has no function in local hostname resolution.

Cecho "192.168.204.11 Payroll" >> /etc/hostsCorrect

The `/etc/hosts` file provides local hostname resolution by mapping IP addresses to hostnames. Adding the entry `192.168.204.11 Payroll` to this file will allow the workstation to resolve 'Payroll' to the specified IP address without relying on DNS.

Decho `IPADDR="192.168.204.11" #Payroll' >> /etc/network/interface

`/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

Source: 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 Practice