Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Apr 22, 2005 4:07 pm 
Offline
Senior Newbie

Joined: Fri Apr 22, 2005 3:50 pm
Posts: 6
This must be a FAQ, but I couldn't find anything.

How do I set the hostname on my Linode? I'm using the default (DHCP) configuration on CentOS 3.1.

I can set the hostname using hostname command, but it does back to the original (liXX-XXX.members.linode.com) on reboot.

Where in the tangle of network scripts and config files is the *right* place to change the hostname for this configuration?

I have DNS and reverse DNS working.


Top
   
 Post subject:
PostPosted: Fri Apr 22, 2005 4:22 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
http://www.linode.com/forums/viewtopic.php?t=1027

-Chris


Top
   
 Post subject:
PostPosted: Fri Apr 22, 2005 4:32 pm 
Offline
Senior Newbie

Joined: Fri Apr 22, 2005 3:50 pm
Posts: 6
Quote:
http://www.linode.com/forums/viewtopic.php?t=1027


That is a good description of how to set up Webmin on CentOS, and I suppose Webmin knows how to set the hostname, but I would rather not run Webmin.

In most problems like this you can grep for hints, but since the default hostname comes from the DHCP server that approach doesn't work in this case :(


Top
   
 Post subject:
PostPosted: Fri Apr 22, 2005 6:35 pm 
Offline
Senior Member
User avatar

Joined: Tue Jan 04, 2005 7:32 am
Posts: 277
Website: http://www.betadome.com/
Location: Ă…lesund, Norway
Skype: neonnero
Twitter: neonnero
I think caker is referring to step 5 in that tutorial.

Quote:
Step Five
Update your hostname

Code:
 echo yourdomainnamehere >/etc/hostname  

Code:
 /bin/hostname -F /etc/hostname 


Top
   
 Post subject:
PostPosted: Fri Apr 22, 2005 9:05 pm 
Offline
Senior Newbie

Joined: Fri Apr 22, 2005 3:50 pm
Posts: 6
Quote:
Code:
echo yourdomainnamehere >/etc/hostname

Code:
/bin/hostname -F /etc/hostname


Ok, I see, Webmin not required I guess. I read too fast, please excuse me.

But this is what I already tried. The problem is on the next reboot I'm back to the original hostname assigned by Linode, I guess it is coming from the DHCP server. Should I invoke /bin/hostname in /etc/rc.local?

Doesn't seem right to set one hostname during startup and immediately switch every time.

I guess I could switch to a static IP configuration if I have to.


Top
   
 Post subject:
PostPosted: Fri Apr 22, 2005 9:53 pm 
Offline
Senior Member
User avatar

Joined: Tue Jan 04, 2005 7:32 am
Posts: 277
Website: http://www.betadome.com/
Location: Ă…lesund, Norway
Skype: neonnero
Twitter: neonnero
I'm using Gentoo myself, and it handles this without problems.

Just to double-check, what is the actual contents of your /etc/hostname file at the moment?


Top
   
 Post subject:
PostPosted: Fri Apr 22, 2005 10:42 pm 
Offline
Senior Newbie

Joined: Fri Apr 22, 2005 3:50 pm
Posts: 6
Quote:
Just to double-check, what is the actual contents of your /etc/hostname file at the moment?


It contains the fully qualified domain name (ending in ".com"). It's three levels: <host>.<domain>.com. Resolves in DNS to the IP address of the Linode UML machine.


Top
   
 Post subject:
PostPosted: Sat Apr 23, 2005 9:47 am 
Offline
Senior Newbie

Joined: Fri Apr 22, 2005 3:50 pm
Posts: 6
Just for the record: I fixed the "HOSTNAME=" line in /etc/sysconfig/network and it seems to be working for me now.

Finally found the right Google keywords and picked up on a discussion from 2003 at LinuxForums.org: http://www.linuxforums.org/forum/topic-350-0.html.

I still have /etc/hostname set but I'm not sure it is required for CentOS.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group