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.
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.
127.0.0.1 should be listed as localhost as this is the loopback addresses used by lots of software. You might also want to add your server's name after 'localhost' if you don't have any other IP addresses (say associated with a network card etc).
At boot time your system must read the hostname from somewhere and set it. So you'll find that your sucessful canges to you hostname won't survive a reboot. Take a look at /etc/sysconfig/network
I was told that there are several different places that need to have the hostname and domainname changed in order for it to work. He told me that the command will take care of it. But I guess it isn't working. Because both /etc/host and /etc/sysconfig/network still say localhost.localdomain
So you are telling me that if I reboot that machine, it will go back to localhost.localdomain?
Neither hostname or domainname change either of the files you've mentioned. You need to change them yourself.
At boot time settings are read from the relevant files and programs like hostname are called to set them for the system. The hosts file (/etc/hosts) is only used to resolve hostnames to ip addresses, it doesn't actually effect what hostname is used by a system.
Try editing /etc/sysconfig/network then reboot and see what happens. If you don't edit the files yourself then yeah - the hostname will be reset to localhost.localdomain the next time you reboot.
One more thing. My friend also told me the reason that I had to change the name using the command was because there might be other parts of the system that will not know the name had changed and that the dependenies would be broke. Is this true?
Originally posted by KennyK That did it thanks for your help.
Originally posted by KennyK One more thing. My friend also told me the reason that I had to change the name using the command was because there might be other parts of the system that will not know the name had changed and that the dependenies would be broke. Is this true?
You were right to use hostname and domainname to change your settings, but to make it persistant accross reboots you needed to edit the files that the system reads at boot time to decide what it should set your hostname/domain name to. I'm sure that there is some nice graphical tool that you would typically use in Redhat to set this, but I've got no idea what it is.