Archive for the ‘Changing Hostname’ Category

Changing Hostname on RHEL

December 10, 2009 Leave a comment

It is possible to change the hostname without reboot; this is very helpful in Production environment.

Here I have change the hostname of the server without restarting on RHEL

Step 01: Change the HOSTNAME line in /etc/sysconfig/network

[root@aca800de root]# vi /etc/sysconfig/network

Step 02: Change the hostname (FQDN and alias) in /etc/hosts

[root@aca800de root]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.         localhost.localdomain         localhost     vasappserver1

Step 03: Run /bin/hostname new_hostname for the hostname change to take effect immediately.

[root@aca800de root]# /bin/hostname vasappserver1
[root@aca800de root]# hostname

Step 04: Run /sbin/service syslog restart for syslog to log using the new hostname.

[root@aca800de root]# service syslog restart
Shutting down kernel logger:                               [  OK  ]
Shutting down system logger:                               [  OK  ]
Starting system logger:                                    [  OK  ]
Starting kernel logger:                                    [  OK  ]