Subject: Re: getting the hostname from DHCP server
To: Hauke Fath <hf@spg.tu-darmstadt.de>
From: Stephen Borrill <netbsd@precedence.co.uk>
List: netbsd-users
Date: 02/17/2006 09:32:35
On Thu, 16 Feb 2006, Hauke Fath wrote:
> Am 16.02.2006 um 9:04 Uhr +0000 schrieb Stephen Borrill:
>> It "just works" on NetBSD too. This relies on the DHCP server sending the 
>> hostname; it won't fall back to the client doing reverse DNS.
>
> No, it doesn't. On netbsd-3, at least, you need to set up a custom 
> /etc/dhclient.conf and request (or require) host-name, and possibly other 
> things that you might want. Per default, the dhcpd provides a rather limited 
> subset of what you can set with dhcp.

I've never found that to be the case. On a clean netbsd-3 install:

# hostname

# dhclient
Internet Software Consortium DHCP Client V3.0.1rc11
Copyright 1995-2002 Internet Software Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP

Listening on BPF/xennet0/aa:00:00:21:0c:d5
Sending on   BPF/xennet0/aa:00:00:21:0c:d5
Sending on   Socket/fallback
DHCPDISCOVER on xennet0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on xennet0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on xennet0 to 255.255.255.255 port 67 interval 12
DHCPDISCOVER on xennet0 to 255.255.255.255 port 67 interval 9
DHCPOFFER from 192.168.1.1
DHCPREQUEST on xennet0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.1
bound to 192.168.1.119 -- renewal in 16957 seconds.
# hostname
xnc119.internal.domain
# cat /etc/dhclient.conf
cat: /etc/dhclient.conf: No such file or directory

Perhaps your DHCP server is set up differently. For instance, I have the 
following in mine:
get-lease-hostnames on;

-- 
Stephen