LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-21-2003, 08:02 PM   #1
vittibaby
LQ Newbie
 
Registered: Aug 2003
Posts: 19

Rep: Reputation: 0
Post 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?
 
Old 08-21-2003, 08:04 PM   #2
vittibaby
LQ Newbie
 
Registered: Aug 2003
Posts: 19

Original Poster
Rep: Reputation: 0
test
 
Old 08-21-2003, 09:47 PM   #3
jdc2048
Member
 
Registered: Jul 2002
Location: Ohio, USA
Distribution: Redhat, Gentoo, Solaris, HP-UX, etc...
Posts: 391

Rep: Reputation: 30
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)
 
Old 08-22-2003, 03:02 AM   #4
vittibaby
LQ Newbie
 
Registered: Aug 2003
Posts: 19

Original Poster
Rep: Reputation: 0
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?
 
Old 08-22-2003, 11:08 PM   #5
vittibaby
LQ Newbie
 
Registered: Aug 2003
Posts: 19

Original Poster
Rep: Reputation: 0
anyone has any tips on how to change hostname on Linux if I'm using dhcp? thanks!
 
Old 08-23-2003, 01:06 AM   #6
electron_lemon
LQ Newbie
 
Registered: Aug 2003
Location: Chicago
Distribution: Mandrake
Posts: 18

Rep: Reputation: 0
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.

Last edited by electron_lemon; 08-23-2003 at 01:07 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Hostname to Domain Name mikebua56 Linux - Newbie 1 11-06-2005 06:53 PM
Wrong Hostname in a MS Domain Zeb Linux - Networking 0 03-16-2004 03:32 AM
Want to set up a new domain name and hostname? hamster Linux - Networking 6 04-06-2003 12:04 PM
hostname vs domain racediver007 Linux - Newbie 5 03-20-2003 03:30 PM
Understanding hostname/domain name SpaceGroove Linux - Newbie 2 01-26-2003 05:42 AM


All times are GMT -5. The time now is 10:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration