One of the basic (yet very useful) operation you can do on a server is to change the hostname. The hostname is basically a label you assign to it so you can identify it more easily.
To change it you need to edit the file /etc/sysconfig/network:
The value from this file is used only on reboot or when you restart the networking deamon.
Next, run the hostname command:
Tip: You can use the hostname command without any parameters to view the current hostname.
Next, you will want to change the values from /etc/hosts:
127.0.0.1 localhost.localdomain localhost myserver.domain.com
To make sure all the services use the new hostname values you will need to restart the network service:
service network restart
That’s it, folks! Yes, it might seem a bit too much for such a simple change, but hey, you don’t do it every day!