LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-22-2013, 11:59 PM   #1
Nathanraymond
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
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

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

Evo2.
 
Old 05-23-2013, 02:10 AM   #3
shivaa
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:
Code:
~$ 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
kooru
Senior Member
 
Registered: Sep 2012
Posts: 1,385

Rep: Reputation: 273Reputation: 273Reputation: 273
Hi,

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
keddie
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
Nathanraymond
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
 
  


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
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:42 AM.

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