How to change the hostname

Option 1 - with reboot

  1. Edit /etc/sysconfig/network.
  2. Edit /etc/hosts.
  3. Reboot.

Option 2 - without reboot

Edit /etc/sysconfig/network.

NETWORKING=yes
HOSTNAME=myhost.localdomain

Edit /etc/hosts to get proper resolving. Don't remove the localhost definitions!

127.0.0.1      localhost.localdomain localhost4.localdomain4 localhost4 localhost
::1            localhost.localdomain localhost6.localdomain6 localhost6 localhost
127.0.1.1      myhost.localdomain myhost

Notify the kernel about your new h...