Tuesday, November 27, 2012

How to change the hostname in Linux

Changing your Linux machine’s hostname is easy. Just follow the steps below.
root# hostname [new-host-name]
root# vi /etc/sysconfig/network
HOSTNAME=[new-host-name]
root# vi /etc/hosts
Make sure your new host is updated in the hosts file.
root# service network restart
Done!!