LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 02-23-2006, 04:44 PM   #1
foxhosting
LQ Newbie
 
Registered: Feb 2006
Posts: 2

Rep: Reputation: 0
Fedora i686/2.4.27-0.3um - Server hostname reverts to original upon server reboot


Hi. New to sysadmin. Have edited the following files:

/etc/hostname
to read:
newhostname.mydomain.com

/etc/sysconfig/network
to read:
NETWORKING=yes
GATEWAY=xx.xx.xx.xx
HOSTNAME=newhostname.mydomain.com
DOMAINNAME=mydomain.com

and I ran:
$ echo newhostname.mydomain.com > /proc/sys/kernel/hostname

$ uname -n
which reports: newhostname.mydomain.com

$ hostname -a
which reports: newhostname

$ hostname -s
which reports: newhostname

$ hostname -d
which reports: mydomain.com

$ hostname -f
which reports: newhostname.mydomain.com

$ hostname
which reports: newhostname.mydomain.com


Server hostname seems to be set at startup from:
/etc/rc.d/rc.sysinit
which calls:
HOSTNAME=`/bin/hostname`
if [ -f /etc/sysconfig/network ]; then
. /etc/sysconfig/network
fi
if [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" ]; then
HOSTNAME=localhost

/bin/hostname
I assume that is the "hostname" command

If I restart the server it reverts to the old hostname.

If I check in WHM>>SERVER CONFIGURATION>>BASIC CPANEL/WHM SETUP
it shows the new hostname

If I check in WHM>>NETWORKING SETUP>>HOSTNAME
it shows the old hostname

If I check /etc/hostname
it shows the new hostname

If I check /etc/sysconfig/network
it shows the old hostname like this:
NETWORKING=yes
GATEWAY=xx.xx.xx.xx
HOSTNAME=oldhostname.mydomain.com

If I type:
$ hostname
on a command line, I get the old hostname as the response

Clearly, something else is setting the hostname on reboot and re-writing /etc/sysconfig/network. Does anyone know what is doing this?

Thanks for any assistance.
D.
FoxHosting Limited

Last edited by foxhosting; 02-24-2006 at 08:15 AM.
 
Old 02-24-2006, 10:23 AM   #2
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
Code:
hostname <new_hostname>
??
 
Old 02-25-2006, 03:39 AM   #3
foxhosting
LQ Newbie
 
Registered: Feb 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for your reply.

Sadly the command:
$ hostname newhostname.mydomain.com
does not resolve the hostname renaming problem on reboot.

Something else other than the settings I have changed is re-setting the hostname on reboot and re-writing /etc/sysconfig/network which is the file that the hostname command appears to be referencing on boot. Does anyone know what is doing this?

Thanks for any assistance.
D.
FoxHosting Limited
 
  


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
forwarding syslog messages overwrites original hostname gfizzy Linux - Software 2 10-30-2009 09:24 AM
Server looking up its own hostname every 2 minutes tunasashimi Suse/Novell 8 07-04-2005 04:02 AM
Server looking up its own hostname every 2 minutes tunasashimi Linux - Networking 2 06-28-2005 06:49 AM
weird hostname appeared, want the original back rksanders Debian 2 12-05-2004 05:53 PM
How to keep the original time of files uploaded to FTP server wondial Linux - Software 1 10-26-2004 10:12 PM


All times are GMT -5. The time now is 07:51 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration