Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.x.x.x NEWhostname.site.domain NEWhostname
192.x.x.x NEWhostname.site.domain NEWhostname
All that is set to the NEWhostname, however the command "hostname" returns the old hostname. I have tried restaring multiple times. If I manually run the command "hostname NEWHOST" and I run "hostname" it will return correctly "NEWHOST". However, my prompt does not change and when I reboot it reverts to OLDhostname.
Quote:
$ hostname
OLDhostname.storefinancial.net
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.
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?
Yes, the old hostname shows up as my prompt, and when I do a "hostname" command after a reboot it is the old FQDN. Where it is getting it from I do not know.
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 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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.