Sunday, June 30, 2013

Hostname Setup/Change on CentOS

Run the following commands as root:
# vi /etc/sysconfig/network

Add the following line:
HOSTNAME=<servername.domain.com>

After saving your changes:
# cp -v /etc/hosts /etc/hosts.bak
# vi /etc/hosts

Add/change the following information:
127.0.0.1 localhost     <servername.domain.com>
<ip-you-want-to-use> <servername.domain.com>
::1             localhost      <servername.domain.com> 

Restart networking
# /etc/init.d/network restart

No comments:

Post a Comment