[Dnsmasq-discuss] [Patch] dnsmasq biased round robin for new requests

Simon Kelley simon at thekelleys.org.uk
Mon Jun 6 11:32:59 BST 2011


harish badrinath wrote:
> Hello,
>> We're still talking, I think.
> :)
>> Assume you have two servers, one of which knows about some domains but
>> the other does not. You query the "special" server first so that it can
>> tell you about those domains. But DNS uses UDP, which is an unreliable
>> transport, so at random, the queries to the special server might get
>> lost, and then the queries will get answered from the second server, and
>> randomly your extra domains get lost. Good luck diagnosing the problem.
> 
> This patch makes the "scheduler" prefer nameservers in resolv.conf with the
> assumption that it was set by DHCP and points to ISP's/ISP  authorised  DNS
> server.
> 
> Then there is the case of ISP's DNS going down, when that happens, it
> contacts the DNS server's given on the command line mostly to answer
> the query, as a last but needed resort.

So dnsmasq already has mechanisms to deal with this sort of thing. It
sends some queries to all the available nameservers in parallel and then
starts to use whichever server answers first. The nameserver race gets
run again regularly to update the notion of the best nameserver, and it
always gets run is a query goes unanswered, to allow a new nameserver to
be picked if  the current on goes down. That should give the behaviour
you want in the face of failed servers, but it works for any failing server.

How is your patch better? Maybe because  it avoids the command-line
server even if it is fastest, unless the others are down? I can see that
would be useful sometimes.

> 
> This (in my world) starts making sense when dnsmasq needs to work
> with  chillispot  (http://www.chillispot.info/)  for  example,
> to whitelist/blacklist certain domains  based on  "business logic"
> and for that dnsmasq needs to communicate with other processes using
> static shared memory.
> 
> 
>> Does that mechanism not solve your problem?
> I did not even consider non uniform DNS servers.
Ok, I misunderstood an earlier reply on that.


> 
> Regards,
> Harish Badrinath
> 




More information about the Dnsmasq-discuss mailing list