Date: 2007nov19
Updated: 2020nov24
OS: Linux
Distro: RedHat/Fedora/CentOS
Keywords: hostname, computer name, reboot
Q. Linux: How do I change the computer name of my RedHat/Fedora/CentOS box?
A. The modern way to set the host name is:
hostnamectl set-hostname EXAMPLE.COM
As root.
This command is part of systemd.
And to query just:
hostnamectl
The older way to set it was:
hostname EXAMPLE.COM
And:
hostname
to query.
Its stored in /etc/hostname
You can also used the the GNOME GUI.
Settings > Network > Wired > (click on the gear icon) > Identity