[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How does a linux dhcp client know it's name?

icebiker wrote:


 I've got a sarge system connected to a DLink D604 router. I'm using
 the router's dhcp server to assign IP addresses to the system. The
 network configuration is what the debian installer gave me.

 Some applications seem to have trouble understanding the network
 configuration. For example, sudo says:

 jvl@flipper:/etc$ sudo aptitude sudo: unable to lookup flipper via

 and hostname seems seriously confused:

 jvl@flipper:/etc$ hostname flipper jvl@flipper:/etc$ hostname -i
 hostname: Unknown host

 Also, the router doesn't seem to be able to get the system's name,
 though it can the names of my Windows systems.

 Poking around, it seems that gethostbyname() looks at the host.conf
 and resolv.conf files, but those files seem to expect a fixed ip
 address. Also, none of the man pages that I could find (where is
 resolv+?) seem to know about /etc/hostname, which I thought was the
 way a Linux system named itself.

 So, I'm missing something here. Is there a way to tell the resolver
 to look /etc/hostname? How does this stuff get tied together?


What is in /etc/hostname ?   Usually setting this will help out a lot
of services if they are confused about the name.  E.G. I had to set
mine to www.ellisbros.com to keep apache2 happy (not generating
warnings in the log) about the name of the machine, even though I had
previously had elllisbros.com in my /etc/hostname.  I vaguely remember
that a long time ago another service wanted to see a correct name in
/etc/hostname (something that jives with DNS records) before it would
start.  Exim perhaps?  I have no experience with aptitude.


fn:Robert Ellis
tel;home:(813) 654-3930
tel;cell:(813) 389-9241

Reply to: