How dhcp client can set its hostname properly on lease time

Brian Reichert reichert at numachi.com
Thu Oct 7 15:14:49 UTC 2010


On Thu, Oct 07, 2010 at 09:37:52PM +0900, Mamoru Iwaki wrote:
> Now, my question is
> 
> Are there good way for dhcp client to set its hostname properly on lease
> time?

Depends on 'properly'.

I've hacked dhclient exit scripts to synthesize a hostname, if one
was not offered by the DHCP server.  The host, under these
circumstances, gets a hostname derived from the IP address and the
supplied domain name, eg: '10-12-34-56.example.com'.

This at least gets the box into a place where it has a hostname
associated with the address on an external interface.

No one else knows that hostname, however.  YMMV.

> 
> Cheers
> 
> --
> -----
> Mamoru IWAKI
> Grad. Schl. Sci & Tech./Dept. Biocybernetics, Niigata University

-- 
Brian Reichert				<reichert at numachi.com>
55 Crystal Ave. #286			
Derry NH 03038-1725 USA			BSD admin/developer at large	


More information about the freebsd-stable mailing list