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