web analytics

Change hostname

To change hostname, login to the server as root and just type

hostname newname

where newname is the new hostname to be set

When you set hostname in that way, changes will be available till the server is rebooted only. For the changes to be effevtive even after a reboot, make the change permanent by doing the following.

vi /etc/sysconfig/network (redhat/fedora specific)

Change HOSTNAME=newname

Save and quit.

Alternatively, check the /etc/hosts file and see if the old hostname is present there. IF yes, correct it as well.

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>