RHEL Linux - Red Hat System Administration Practice Exam

Disable ads (and more) with a membership for a one time $4.99 payment

Study for the RHEL Linux - Red Hat System Administration Exam. Enhance your knowledge with flashcards and multiple-choice questions, complete with hints and explanations. Prepare for your certification!

Practice this question and more.


Which file is used to configure the system's hostname in RHEL?

  1. /etc/hostname

  2. /etc/sysconfig/network

  3. /var/run/hostname

  4. /usr/local/etc/hostname

The correct answer is: /etc/hostname

The file used to configure the system's hostname in RHEL is indeed /etc/hostname. This file is critical because it is specifically designated for storing the hostname of the system. When the system boots up, it reads the hostname from this file and sets it accordingly. RHEL and many other Linux distributions utilize this file for a persistent hostname setting, which means that the hostname configured here will remain across reboots. By editing this file and inserting the desired hostname, you can ensure that the system identifies itself by this name consistently. In addition, changes to the hostname might also require a command like 'hostnamectl set-hostname' in modern RHEL versions, which work alongside the /etc/hostname file to manage the system's hostname dynamically. The other options either do not serve the specific purpose of configuring the hostname or are not standard locations for such configurations in RHEL.