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
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
network services