nerdexam
CompTIACompTIA

XK0-005 · Question #108

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

The correct answer is D: # echo "192.168.1.100 production.company.com" >> /etc/hosts. hostnamectl is for your own host name and it modifies the /etc/hostname file (your name). The /etc/hosts file, as lizano stated maps hostnames and IPs of other systems and has a priority over

System Management

Question

A Linux administrator is setting up a testing environment and needs to connect to a separate testing server using the production server name. The administrator needs to override the hostname that the DNS is returning in order to use the test environment. Which of the following commands should be run on each of the testing systems to BEST meet this goal? # hostnamectl set-hostname "192.168.1.100 production.company.com" A.

Options

  • B# grep -i IP "${ip addr show} production.company.com" > /etc/resolv.conf
  • C# ip addr add 192.168.1.100/24 dev eth0 && rndc reload
  • D# echo "192.168.1.100 production.company.com" >> /etc/hosts

Explanation

hostnamectl is for your own host name and it modifies the /etc/hostname file (your name). The /etc/hosts file, as lizano stated maps hostnames and IPs of other systems and has a priority over

Topics

#Hostname resolution#/etc/hosts file#Network configuration

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions