Hostname is usually set when installing the machine, but sometime you need to change it.
To print current set hostname
To temporarily change the hostname.
To permanently change the hostname, edit the /etc/sysconfig/network and set the HOSTNAME property.
After saving the configuration, you will need to reboot your machine.