Ask Your Question

Revision history [back]

The hostname of the machine is being managed from systemd and hostnamectl command. There is no need to use any other tool or edit manually any file (basically it's not recommended).

If you want to set the hostname for your system you can do it like this (as root):

# hostnamectl set-hostname --static "YOUR-HOSTNAME-HERE"

reboot the system and see

$ hostnamectl

command output.

Sometimes SELinux playing its own game, you can use

# restorecon -v /etc/hostname

if you have any problems related to hostname changing.