Subject: Re: No nameservers configured when using DHCP/dhclient
To: Lee W <>
From: Steven M. Bellovin <>
List: netbsd-users
Date: 05/18/2003 10:26:01
In message <>, Lee W writes:
>>>Firstly, when using DHCP every setting is configured apart from the 
>>>nameservers (IPv4 address, gateway, netmask & network address).  To the 
>>>best of my knowledge I ran though the DHCP-HowTo correctly, I have tried 
>>>also with an empty dhclient.conf file, no dhclient.conf file at all, a 
>>>blank resolv.conf/no resolv.conf.  Nothing I try seems to solve the 
>>>problem.  I was unable to retrieve any hints from the appropriate man 
>>>pages that provided any info.
>> I had a similar problem when installing 1.6.1. The dhcp configuration during
> installation does not set the nameserver, and this has to be set manually.
>> It can be set during installation, or later in resolv.conf.
>> My resolv.conf (an ADSL line):
>> ------------------------
>> search
>> nameserver
>> ------------------------
>I have set it manually which as you say works fine.  Unfortunately my 
>ISP seems to switch around 5 different DNS servers which means some are 
>not always available (down for maintenance I guess).  This is why I need 
>DHCP on them.

You could always run your own nameserver -- there's a lot to be said 
for that.

But make sure you have a line like this in your dhclient.conf file:

	request subnet-mask, broadcast-address, routers, domain-name, domain-name-servers;

You could even say

	require domain-name-servers;

to make it abort if it doesn't get any.

		--Steve Bellovin, (me) (2nd edition of "Firewalls" book)