Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 05-22-2013, 11:59 PM   #1
LQ Newbie
Registered: May 2013
Location: Portland, OR
Posts: 5

Rep: Reputation: Disabled
Question LINUX Hostname Question

I am still fairly new and run into an issue with hostname. any time I reboot it loses the hostname i change it back and when it is rebooted it loses hostname. What am I doing wrong? or what do I need to do please help if you can
Old 05-23-2013, 01:39 AM   #2
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,009

Rep: Reputation: 1391Reputation: 1391Reputation: 1391Reputation: 1391Reputation: 1391Reputation: 1391Reputation: 1391Reputation: 1391Reputation: 1391Reputation: 1391

at boot time the hostname is set from the contents /etc/hostname. Did you change that?

Old 05-23-2013, 02:10 AM   #3
Senior Member
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Which distro/version of linux you're using? Are you using DHCP for internet? And what did you get when you invoke following command:
~$ hostname
Meanwhile, I am not sure about Linux, but in Solaris you can create /etc/nodename file and can specifiy your desired hostname in that, so next time you boot your system, your system will get hostname specified in /etc/nodename irrespective of DHCP. Once check this blog.

Last edited by shivaa; 05-23-2013 at 04:30 AM. Reason: Link added plus reformatting
Old 05-23-2013, 03:41 AM   #4
Senior Member
Registered: Sep 2012
Posts: 1,385

Rep: Reputation: 274Reputation: 274Reputation: 274

maybe you are changing the hostname in this way: hostname new_name_that_you_want
But to do it permanent, you have to edit the hostname file. It depends from the distro: usually is /etc/hostname
Old 05-23-2013, 04:28 AM   #5
LQ Newbie
Registered: May 2013
Posts: 1

Rep: Reputation: Disabled
For RHEL/CentOS/Fedora and similar distros you may check /etc/sysconfig/network.
there is HOSTNAME variable that you may update to keep the new name persistent.
Old 05-23-2013, 08:35 PM   #6
LQ Newbie
Registered: May 2013
Location: Portland, OR
Posts: 5

Original Poster
Rep: Reputation: Disabled
Cool Thanks

Thanks everyone change the hostname file worked Thanks for your help


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
set linux hostname & question about set multiple domain on one ip l0pht Linux - Networking 4 06-08-2012 10:14 AM
Linux Hostname Question damteke Linux - Networking 3 10-20-2009 03:01 PM
hostname question?? rnj Linux - Newbie 1 10-08-2004 07:09 AM
hostname question wendallsan Linux - Networking 4 10-16-2003 04:46 PM
Hostname Question darkfnord Linux - Newbie 1 09-04-2003 07:27 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:31 PM.

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