I am trying to change the hostname to host01 on an instance that was is using the RightImage_CentOS_5.4_x64_v5.6 - 11H2.a1 [rev 11] MCI.
So I set the /etc/hosts file to:
127.0.0.1 localhost localhost.localdomain 10.76.249.192 host01
and set the /etc/sysconfig/network file:
After the reboot, everything looks good. The hostname is changed:
$ /bin/hostname host01
However, a new file appeared in the system /etc/hostname with, the following content:
The /etc/hosts host file looks like this:
127.0.0.1 localhost localhost.localdomain 10.76.249.192 host01 10.76.249.192 ip-10-76-249-192.ec2.internal ip-10-76-249-192
After reboot, if I drop into an other user, the hostname will change back:
$ hostname ip-10-76-249-192
Does anybody has any idea why this is happening and how stop this?