CentOS 4.4 Changing hostname Problem
The specific hostnames have been changed for your protection :).
I have changed the 3 locations I know for a redhat host. Here are some results on this system: Quote:
Quote:
Distro info: me@OLDhostname ~ $ cat /etc/issue CentOS release 4.4 (Final) Kernel \r on an \m I hope there is a simple fix I am missing, as I am quite confused. Thanks for any help. |
Once you reboot the new hostname will show up.
You only had to change the /etc/sysconfig/network file and that does it. Hosts file still needs updated though. To change the hostname for this session without rebooting do a: hostname newhostname.fully.qualified.name.com That works until the machine is rebooted. But once rebooted it will pick up the name from the /etc/sysconfig/network file. So you'll be good to go. :D |
As god is my witness that is not working. This is my /etc/sysconfig/network file:
NETWORKING=yes HOSTNAME=nagios001 GATEWAY=10.x.x.x When I reboot it is the same old hostname is was before, but now I have no idea where it could even be pulling it from. I wish I was making this up. |
Can you set the hostname via the command line:
hostname newhostname Does that work? |
Warning, silly question coming .......
How do you know it's the same old hostname ...in otherwords where do you see the old hostname? It's not in your prompt or something like that is it? |
Quote:
The "hostname NEWHOST" command will not change my prompt, but if I issue it and then just "hostname" it does show the correct NEWhostname. It does not however persist through a reboot. I appreciate your help. I tried this as well: echo "newhost" > /proc/sys/kernel/hostname but with a reboot it was unsuccessful as well. |
I hate to go this route, but I have seen systems where, when the hostname was set via the gui you have to get back into the gui to change it. It must be hiding somewhere.
My suggestion is to go into the gui / network settings and change the hostname there. Maybe that will appease the gods. Good luck. |
Possible thoughts of change is in /etc/bashrc or /etc/rc.local
Brian |
All times are GMT -5. The time now is 01:02 AM. |