[Dnsmasq-discuss] Round-Robin DNS with >3 IPs rotating in pairs?

Simon Kelley simon at thekelleys.org.uk
Wed Sep 5 15:57:36 BST 2012


On 05/09/12 13:49, Sandro Mathys wrote:
> Hi,
> 
> I've tried to set up a pretty minimal dnsmasq service. Basically the
> configuration file is empty, no parameters provided. That way, as I
> understand it, it should use /etc/resolv.conf to find nameservers and
> also read /etc/hosts. So far this seems to work.
> 
> Now in /etc/hosts, I have something like:
> 
> 10.0.0.1 test
> 10.0.0.2 test
> 10.0.0.3 test
> 10.0.0.4 test
> 10.0.0.5 test
> 10.0.0.6 test
> 
> If I do a 'dig @localhost test', I get the following results. IPs
> shortened to the last quadruple for my convenience :)
> 
> The first time:
> 1, 2, 3, 4, 5, 6
> 
> Second time:
> 3, 4, 5, 6, 1, 2
> 
> Third time:
> 5, 6, 1, 2, 3, 4
> 
> And then again from the beginning.
> 
> Now I've been wondering why dnsmasq would rotate the IPs in pairs of
> two. That's way less useful than rotating one IP at a time. 2, 4 and 6
> will hardly get any traffic at all like this. Is that a bug? Do I need
> to change something?
> 

When I do the same test, I see the order rotate by one. the rotation
happens after each query, so the most obvious explanation is that you
dig test are actually each making two DNS queries. You can easily see if
this is true using the dnsmasq --log-queries option.


Cheers,

Simon.





More information about the Dnsmasq-discuss mailing list