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

Re: How to make DNS and DHCP server play nice?



On Thu, May 29, 2003 at 10:51:38PM -0400, Jerry Quinn wrote:

> That's one.  You don't have to go out of your way in the simple case
> to get dnsmasq to forward dns requests upstream.  It also incorporates
> /etc/hosts into its cache.

Just so I'm clear, the reason it reads /etc/hosts is so that some other 
machine can look up the IP of the machine where dnsmasq is running.  In 
other words, dnsmasq can figure out all the hosts (and their IPs) from 
reading the leases file except the machine running dhcpd (and also 
dnsmasq) won't have an entry in the leases file so dnsmasq has to read 
it from the /etc/hosts file.

I just connected to my friends machine and noticed this:

$ dig @localhost blackdell
[...]
;; ANSWER SECTION:
blackdell.              175     IN      A       192.168.1.81
blackdell.              475     IN      A       192.168.1.81

I suppose that's not a problem.  (Round-robin DNS pointing to the same 
IP...)

> The real value for me is that dnsmasq will watch dhcpd.leases and
> incorporate dynamic IP clients into its cache.  I have the common
> configuration of a single gateway with a handful of machines behind
> it.  Running dhcp on the gateway makes it simpler to admin internal
> addresses.  And dnsmasq means I get name services for the dynamic
> clients without working hard.

Very nice.  I don't think the bind config is overly complicated (once
you figure it out) but dnsmasq is nice because you don't need to
duplicate information.  I have internal hosts listed in dhcpd.conf
(fixed IP numbers), and in a local zone for forward lookups, and in
another zone for reverse.

I wonder if I could use bind on eth0 and dnsmasq on eth1.  Seems like 
I'd have a lame server for my real domains when an internal machine 
asked the dnsmasq/bind machine to do a lookup.

By the way, on my LAN (that uses fixed IPs via dhcpd and MAC address) my 
leases file does not show "client-hostname".  Is there something that 
needs to be setup with dhclient to send the hostname to dhcpd?


-- 
Bill Moseley
moseley@hank.org



Reply to: