Change the Hostname in CentOS

1. Add the hostname in /etc/sysconfig/network file

NETWORKING=yes
HOSTNAME=host.domain

2. Add the entry in /etc/hosts file

In new line ,

IP host.domain host

3. echo “host.domain” > /proc/sys/kernel/hostname

4. hostname host.domain

5. service network restart

Advertisements

One thought on “Change the Hostname in CentOS

  1. Pingback: apr_sockaddr_info_get() failed « theG

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s