[Dnsmasq-discuss] Behaviour for multiple server=/domain/ip entries?

Simon Kelley simon at thekelleys.org.uk
Mon Nov 22 15:05:23 GMT 2010


Andreas Schamanek wrote:
> Hi fellow dnsmasq'ers,
> 
> My dnsmasq 2.45 (on Debian) reads the system's DNS servers from 
> /etc/resolv.conf. In /etc/dnsmasq.conf there are several server 
> entries for a special domain, like
> 
>   server=/example.com/63.58.50.220
>   server=/example.com/63.189.112.181
>   server=/example.com/196.141.89.219
> 
> Looking at the dnsmasq stats (after a SIGUSR1) I found that 
> apparently only the 1st server entry is used. Quoting from the stats
> 
>   server 63.58.50.220#53: queries sent 3371, retried or failed 0
>   server 63.189.112.181#53: queries sent 0, retried or failed 0
>   server 196.141.89.219#53: queries sent 0, retried or failed 0
> 
> Then I tried dnsmasq 2.55 on a Debian Testing machine:
> 
>   server 63.58.50.220#53: queries sent 8, retried or failed 0
>   server 63.189.112.181#53: queries sent 8, retried or failed 0
>   server 196.141.89.219#53: queries sent 8, retried or failed 0
> 
> Here, all 3 are used as I expected it.
> 
> Was this a feature which had been added between 2.45 and 2.55? I 
> looked at the changelog but couldn't find anything about it. Or is my 
> setup on the 2.45/Debian stable machine broken?

The change happened in version 2.53:

"           Tweak DNS server selection algorithm when there is more
            than one server available for a domain, eg.
            --server=/mydomain/1.1.1.1
            --server=/mydomain/2.2.2.2
"

Which isn't too informative, I concede.

> 
> Also, I am wondering whether there is a proper way to set up some 
> sort of distributed DNS for a specific domain. Say, I have the above 3 
> entries for example.com but I want dnsmasq to query only 1 DNS server 
> at a time in order to distribute the load.


The earlier code only ever used one server: the later code always
distributes each query to all servers available for a domain. Neither of
these is ideal: a beter approach would be to use the same algorithm
that's used for selecting servers when a domain-specific server isn't
involved, but even this isn't actually much use at doing load balancing,
it favours one server until it fails to reply.

There's a tension between getting answers in the face of one or more
broken servers and even load distribution. Dnsmasq is written with the
former in mind, because that's most useful in niche is was designed for,
I guess.


Cheers,

Simon.

> 
> MTIA,
> 





More information about the Dnsmasq-discuss mailing list