Thursday 29 May 2014

Steps to change hostname in CentOS 6




Temporary

# hostname <new-hostname>



Permanent

In the file /etc/sysconfig/network, change the value of the variable HOSTNAME.

# vi /etc/sysconfig/network
HOSTNAME=<new-hostname>

Then, restart the network service.

# service network restart

Check if the hostname has changed by running the hostname command:

# hostname

If that does not work, try and reboot the machine.


No comments:

Post a Comment