Wednesday, May 26, 2010

How to change the hostname in Linux

To change the host name in Ubuntu, Debian,.....

# vi /etc/hostname

new_hostname

# /etc/init.d/hostname.sh restart

To change the host name in Redhat,CentOs,fedora,......

Give the new hostname in the following files

# vi /etc/hosts
# vi /etc/sysconfig/network

OR

# sysctl kernel.hostname=new_hostname


.

No comments:

Post a Comment