XK0-004 · Question #431
A server technician deployed ten ctoned Linux devices in an organization. When testing network functionality of the devices, the technician notices the cloned devices have identical hostnames. Which…
The correct answer is B. Edit the /etc/sysconfig/network file. On RHEL/CentOS-based Linux, the /etc/sysconfig/network file stores the persistent hostname that survives reboots, making it the correct file to edit for permanent hostname changes.
Question
A server technician deployed ten ctoned Linux devices in an organization. When testing network functionality of the devices, the technician notices the cloned devices have identical hostnames. Which of the following commands si hostnames of the devices permanently'?
Options
- AEdit the 'etc/dhcp/dhclient .conf file.
- BEdit the /etc/sysconfig/network file.
- CIssue the host- command
- DIssue the nslookup command
How the community answered
(20 responses)- B85% (17)
- C10% (2)
- D5% (1)
Why each option
On RHEL/CentOS-based Linux, the /etc/sysconfig/network file stores the persistent hostname that survives reboots, making it the correct file to edit for permanent hostname changes.
The /etc/dhcp/dhclient.conf file controls DHCP client options such as lease behavior and requested parameters - it has no role in setting the system hostname.
The /etc/sysconfig/network file contains the HOSTNAME variable on Red Hat-based Linux distributions and is read at boot time, ensuring any value set there persists across reboots. Editing this file with a unique HOSTNAME entry for each cloned device resolves the duplicate hostname problem permanently. This is the traditional RHEL/CentOS method for static hostname assignment without requiring a running service.
The 'host-' string as written is not a valid Linux command; even if interpreted as a truncated 'hostnamectl' reference, the option as presented is incomplete and not a recognized utility.
nslookup is a DNS query tool used to resolve hostnames and IP addresses from a name server - it cannot set or modify the local system hostname.
Concept tested: Permanent hostname configuration on RHEL-based Linux
Source: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec_configuring_host_names_using_the_command_line
Topics
Community Discussion
No community discussion yet for this question.