[Dnsmasq-discuss] Multiple upstream servers

Jay Guerette jayguerette at gmail.com
Wed Mar 14 20:28:22 GMT 2007


On 3/14/07, Simon Kelley <simon at thekelleys.org.uk> wrote:
> Jay Guerette wrote:
> > In my dnsmasq.conf I have the following lines:
> >
> > server=199.2.252.10
> > server=204.97.212.10
> > server=204.117.214.10
> >
> > If I run tcpdump to examine the DNS traffic, I'll see something like
> > this right after dnsmasq starts:
> >
> > 15:50:06.302001 IP 10.0.2.10.33109 > 199.2.252.10.53:  35868+ A?
> > www.google.com. (32)
> > 15:50:06.302330 IP 10.0.2.10.33109 > 204.97.212.10.53:  35868+ A?
> > www.google.com. (32)
> > 15:50:06.302363 IP 10.0.2.10.33109 > 204.117.214.10.53:  35868+ A?
> > www.google.com. (32)
> >
> > It seems to test all the servers; but then, it always uses the 1st
> > entry, and never uses the others:
> >
> > 15:50:33.629819 IP 10.0.2.10.33109 > 199.2.252.10.53:  27414+ A?
> > www.vonage.com. (32)
> <snip>
> >
> > If I change the order of the server= lines in my .conf, it will repeat
> > the initial 'test' behavior and then use the new 1st entry again.
> > Enabling/disabling 'strict-order' has no impact.
> >
> > I have tested on RH 9 with v2.38, and Ubuntu 6.06 with v2.25.
> >
>
> I'm not sure what your question is. You are right that dnsmasq tests the
> servers on the first query: whichever replys first gets used. If the
> server in use stops responding or responds very slowly, the test will be
> done again, and a new server will be selected. It's likely that all
> three of your servers are about equal, so the first one tends to win the
> race, because the query gets sent to it first.
>
>
> "strict-order" should stop the testing - the first server will always be
> used, and if it does not respond, then the query will go to the second
> one when it is re-tried. Have you seen different results to this?

I'm sorry, I did not actually ask a question; I meant to ask:

Is this the expected behaviour?

I was surprised; and expecting a load balancing of the 3 configured
servers. The man entry for the 'strict-order' option says:

"... dnsmasq will send queries to any of the upstream servers it knows
about and tries to favour servers to are known to be up..."

I interpreted this to mean it would use all the servers that are up,
and tune the load on each in the pool based on it's response times.
Specifically the words "favour servers", lead me to believe it would
use more than one. I interpreted the use of the 'strict-order' option
was to strictly round-robin, with no attention paid to response times.

Now I know, this is the expected behaviour. Thank you for your reply.



More information about the Dnsmasq-discuss mailing list