Digital Marketing

How to Set Hostname on CentOS (RHEL)


How to Set / Change Host Name in CentOS 7 / RHEL 7 / Oracle Linux 7

See also:

To temporarily set the host name of centos, use hostname command.
However, once the server is rebooted, the hostname will revert to it's previous setting.To permanently change the hostname, you need to edit the network file at /etc/sysconfig/network.

where <value> should be the Fully Qualified Domain Name (FQDN), such as, but can be whatever hostname is necessary.

You can also edit /etc/hosts:   myhostname localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         myhostname localhost localhost.localdomain localhost6 localhost6.localdomain6


Popular posts from this blog

MySQL Sandbox with the Sakila sample database