HOW TO CHANGE HOSTNAME RED HAT LINUX

HOW TO CHANGE HOSTNAME RED HAT LINUX



1.-Validate Hostname and host file that you need to change

#hostname
rhel

#cat /etc/hosts
127.0.0.1  localhost
192.168.1.13  rhel

2.-Edit the following file in order to change HOSTNAME
#vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=TEST
GATEWAY=192.168.1.1

3.-When you are ready and you save the information you will need to edit the hosts file

#vi /etc/hosts
127.0.0.1  localhost
192.168.1.13  test

4.- Finally you will need to restart de network services
#service network restart
#hostname
test

Comments

techperson said…
To be honest, I don’t know how you manage to do such a good job every single time. Very well done!
network services