LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to change hostname / domain name if using dhcp (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-change-hostname-domain-name-if-using-dhcp-84354/)

vittibaby 08-21-2003 08:02 PM

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?

vittibaby 08-21-2003 08:04 PM

test

jdc2048 08-21-2003 09:47 PM

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)

vittibaby 08-22-2003 03:02 AM

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?

vittibaby 08-22-2003 11:08 PM

anyone has any tips on how to change hostname on Linux if I'm using dhcp? thanks!

electron_lemon 08-23-2003 01:06 AM

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.