How to serve DHCP'ed nameservers?

Glenn Satchell Glenn.Satchell at uniq.com.au
Wed Feb 7 16:44:25 UTC 2007


>From: "Jorge Canas" <jcanas2000 at hotmail.com>
>To: dhcp-users at isc.org
>Subject: How to serve DHCP'ed nameservers?
>Date: Wed, 07 Feb 2007 11:24:05 -0500
>
>Hi,
>
>I have setup a home gateway (2 ethernet cards, one on the WAN and the other 
>on my private network (vpn)).
>
>The WAN interface gets configured via DHCP from my ISP.  The ISP also 
>provides the addresses of its primary and backup nameservers.
>
>The VPN interface has a private static IP address, and this interface is a 
>DHCP server for other nodes in my VPN: I will call this my local DHCP 
>server.
>
>Anyway, so far, this a very vanilla setup.
>
>Now, what I am having trouble figuring out how to do is how do I make my 
>local DHCP server assign the ISP nameservers to the vpn clients?  I know I 
>can edit dhcpd.conf and hard code the IP addresses of the nameservers there, 
>but I am trying to avoid doing that.  I would like this to be automatic...  
>Anyone know how to do that?

There's no direct way to do it, but there are some hacks.

Generally these rely on the ISP not changing the IP address of their
nameservers very often. They shouldn't really do that, so don't try and
make things too difficult, just do what's easy. However, a couple of
things to think about:

You could run a name server on your box that bypasses the ISP's name
servers and goes straight to the root name servers. Then in dhcpd.conf
assign your box to the name servers field. However, this may actually
be slower than using the cached name server lookups from the ISP. If
lots of pwole do it then it adds extra load to the root name servers.

In your gateway dhclient script add some code to create a file containg
one line listing the name servers, eg:

  option domain-name-servers a.b.c.d, e.f.g.h;

Use an 'include filename' statement in dhcpd.conf to include the
generated file. Restart dhcpd.conf fropm the dhclient script whenever
the include file changes. Your clients will pick up the new details
when they renew their leases.

regards,
-glenn


More information about the dhcp-users mailing list