hostname question (urgent)
Currently etc/hosts is:
127.0.0.1 localhost.localdomain localhost I want to change name of the machine from localhost to "ABC" Which part should I modify? localhost.localdomain -> ABC.localdomain [Name] or localhost -> ABC [Alias] or both? And, any other files needed to be modified? |
By the way,
etc/sysconfig/network contains: HOSTNAME = localhost.localdomain Should I modify this one? And, lastly, after changing name of the localhost;can "sendmain" cause any problems when starting? |
Neither will change the hostname. /etc/hosts is only used to map hostnames to ip addresses (the precursor to DNS). You need to leave the entry for localhost as it is.
What distro are you running? Different distros set the hostname in different places. Once you've changed the hostname you'll want to add an entry for your new hostname in /etc/hosts on a new line. cheers Jamie... |
I have RedHat Advanced Server 2.1 installed.
I hope you know what file I should modify to change the name of the machine from localhost to something else.. Peace.. |
Quote:
Once this is done edit /etc/hosts to reflect the change of name, add a line for the new hostname, leave the old entry for localhost alone or things may go screwy. Quote:
cheers Jamie... |
Did I understand right? What I gotta do is:
1. Editing etc/sysconfig/network and changing the line "HOSTNAME = localhost.localdomain" to "HOSTNAME = ABC" 2. Rebooting 3. Editing etc/hosts and adding the line "127.0.0.1 localhost.localdomain ABC" under the line "127.0.0.1 localhost.localdomain localhost" Are these 3 steps correct? |
As soosn as you confirm, I'll apply the steps :-)
|
Won't you confirm?
Is there anything wrong? |
Easy now, its only been a few minutes since the last update! If someone takes a while to respond it might be becuase they're in a different timezone, or gone to lunch or something! (Or actually doing some work in my case...)
Step 1 is correct, then edit /etc/hosts and add "ABC" to the end of the localhost line (assuming you don't have another IP address), then reboot. HTH Jamie... |
I am sorry about that.. And thank you by the way.
Actually, I have one more line under the "127.0.0.1 localhost.localdomain localhost" which is "21......... qua..... q..." Does the existence of this line change anything? Now what should I do? "127.0.0.1 localhost.localdomain ABC" "21......... qua..... q..." Does it work, when the file contains these 2 lines? |
All /etc/hosts allows you to do it type things like "ping ABC" instead of having to use the ip address "ping 127.0.0.1". If your want ABC to be associated with a different IP address then you need to put that in /etc/hosts. You can have as many different entries in /etc/hosts as you want, so the 'other' line will simply be an entry for another box.
So long as your hostname appears to have changed and you can ping your hostname from the command line then that's it done. Keep in mind that entries in /etc/hosts only effect your machine. cheers Jamie... |
you will require to change the /etc/sysconfig/network entry
HOSTNAME=mylinux.domain.com leave the 127.0.0.1 entries in /etc/hosts as they are... add your ipaddress and add assign names to it, for example, 172.16.200.1 abc.mydomain.com abc |
All times are GMT -5. The time now is 09:04 PM. |