Home > Changing Hostname > Changing Hostname on RHEL

Changing Hostname on RHEL

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.ring.com.bd     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  ]
  1. No comments yet.
  1. No trackbacks yet.

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

%d bloggers like this: