Which command sets the hostname permanently to a new value?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which command sets the hostname permanently to a new value?

Explanation:
On systemd-based systems, making a hostname change permanent means updating the static hostname that is written to disk and used at boot. The standard way is to use the hostnamectl tool to set the hostname. Running the plain command to set the hostname updates the static hostname and also applies the change to the running system, so the new name sticks after reboot. The other forms either target a different aspect (like only the static form) or rely on the separate hostname command, which changes only the runtime value and isn’t guaranteed to persist across reboots.

On systemd-based systems, making a hostname change permanent means updating the static hostname that is written to disk and used at boot. The standard way is to use the hostnamectl tool to set the hostname. Running the plain command to set the hostname updates the static hostname and also applies the change to the running system, so the new name sticks after reboot. The other forms either target a different aspect (like only the static form) or rely on the separate hostname command, which changes only the runtime value and isn’t guaranteed to persist across reboots.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy