hostname curiosity

Steve zephod at cfl.rr.com
Mon Jan 26 15:59:11 UTC 2009


---- "Mikkel L. Ellertson" <mikkel at infinity-ltd.com> wrote: 
> Steve wrote:
> > When I boot my F9 box it can have one of two different host names
> > and I would like to figure why this is.
> > 
> > One of the hostnames, hp<number> is the name set by the manufacturer
> > and it's probably in the BIOS. I think that the other one is set via
> > dhcp. Our network dhcp server is a Windows box. The pattern seems to
> > be that when I first turn the machine on, it gets the hp<number>
> > hotsname but if I reboot, I get the dhcp name. I would like to
> > always get the dhcp name.
> > 
> > Any suggestions how on to investigate this?
> > 
> The only way I could see the hostname being set by the BIOS is if it
> did the connection to the DHCP server. (Network boot?) It is
> possible to set up the DHCP request to request a specific hostname,
> or the DHCP server to assign a specific hostname.
> 
> You can try setting "DHCP_HOSTNAME" in the config file for the
> interface and see if that helps.
> 
> You can also set the hostname in /etc/sysconfig/network.

I *could* set dhcp to request a specific filename - I do this on my home machine by creating a /etc/dhclient.conf file containing "send host-name "my host name";" - but that wouldn't satisfy my curiosity and besides, the host name really should be set by the dhcp server.

I'll try adding DHCP_HOSTNAME to /etc/sysconfig/network-scripts/ifcfg-eth0. Currently it contains BOOTPROTO=dhcp plus a few other things.

/etc/sysconfig/network contains
NETWORKING=yes
HOSTNAME=localhost.localdomain

so the system seems to be ignoring that hostname altogether.

Steve




More information about the users mailing list