How to rename a Redhat system.

Thursday, September 13th, 2012

Every once in awhile there is a need to rename a Redhat box.  Normally, I would prefer to reload them but there are times where the setup must be retained or the setup is relatively clean and reusable.

Renaming a Redhat box is easy.

1) vi /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=computername
GATEWAY=xxx.xxx.xxx.254
NISDOMAIN=domain.com

2) change the entry for HOSTNAME= to the new hostname.

NETWORKING=yes 
HOSTNAME=newcomputername
GATEWAY=xxx.xxx.xxx.254 
NISDOMAIN=domain.com

3) change the system names in /etc/hosts

There have been times where the hosts file remains unchanged.  Edit the file for the new names.

4) reboot the system and the new name should take effect.

Don’t forget to update DNS and NIS!

 
 

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: