How to change hostname / domain name if using dhcp
Hi, If I use dhcp to obtain my ip address, how do I change my hostname and domain name? what commands do I need to issue and what files do i need to change?
currently, I'm doing the following: type "hostname abc@abc.com" change the hostname in "/etc/sysconfig/network" to abc@abc.cm If I use just the hostname abc, then I always get the message unqualified domain name. That's why I added the @abc.com at the end. I have my own domain name and am trying to set up a mail server (sendmail), thererfore, maybe including the domain name is a good idea too? |
test
|
You shouldn't be using an @ symbol in there. Try replacing that with a dot;
me.mydomain.com (FQDN, or almost... would need a trailing dot as well) instead of me@mydomain.com (e-mail address) |
Sorry, I did use abc.abc.com. It was just a typo.
So, if I need to change the hostname, that's all I need to do? ie.. type "hostname abc.abc.com" change the hostname in "/etc/sysconfig/network" to abc.abc.cm anything else? |
anyone has any tips on how to change hostname on Linux if I'm using dhcp? thanks!
|
Also helpful might be insering that line in /etc/rc.d/rc.local so that it gets changed each time you boot.
Also, it doesn't need to be a FQDN. It can just be a single hostname, for example: hostname mybox See if that helps. |
All times are GMT -5. The time now is 11:04 AM. |