[Dnsmasq-discuss] [PATCH] --dont-mirror-queries option

Simon Kelley simon at thekelleys.org.uk
Sat Feb 13 13:09:00 GMT 2016


On 06/02/16 00:01, Chris Novakovic wrote:

> Before writing this patch I tried to get similar functionality by
> setting up secondary DNS-only servers on each of the hosts and having
> them refuse queries that couldn't be answered locally, then configuring
> the primary dnsmasq servers in the way you suggested. I decided that it
> wasn't an ideal solution because I'm also using the DHCP server
> functionality of dnsmasq on all three hosts, and I wanted the names of
> their DHCP clients to be resolved correctly too. In that scenario, the
> definition of "locally" is murky: the secondary dnsmasqs technically
> don't have DHCP lease databases of their own, and would have to share
> the dnsmasq.leases file (or, at least, the leases contained within it)
> with the primary dnsmasq. I wrote a --dhcp-script script to work around
> this, but it didn't give me the results I was looking for (I'm hazy on
> the details now, but I recall that the secondary dnsmasq wasn't always
> notified of static /and/ dynamic DHCP lease events and the two dnsmasqs
> would get out of sync, which sort of defeated the point). I tried to
> solve the problem in a number of other ways that wouldn't have required
> patching the code (including using --leasefile-ro and maintaining my
> "own" leases database elsewhere), but again there were strange corner
> cases that would lead to each dnsmasq giving a different response to the
> same query.
> 


Will try and remember to reply to your other points, but on this one,
the way I'd do it (assuming you don't have problems with slow or
intermittent connectivity) is to have one (primary) dnsmasq which is the
DHCP server for all three networks. You declare all the address ranges
in the config of the primary, and tell the secondaries to do dhcp-relay
to the primary.

That keeps all the DHCP address information in the primary, so as long
as the secondaries forward to the primary, all names should be resolvable.


Cheers,


Simon




> 




More information about the Dnsmasq-discuss mailing list