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!