[Dnsmasq-discuss] Limiting the number of IP addressess in DNS reply

Michal Taborsky michal at taborsky.cz
Tue Mar 21 16:29:20 GMT 2017

Hello everyone,

we are using dnsmasq with local hosts file, which lists all servers
providing a given service. So the hosts file looks something like this: service1 service1 service1 service1 service2

In this case, dnsmasq returns a list of IP addresses when you query for
service1 and the list is randomized (or shifted by one apparently, which is
OK), so it serves as a primitive load balancer too, because the apps will
pick the first one. All is well.

But the problem arises, when there are many servers, that provide service1.
Because dnsmasq returns all of the IPs, the response does not fit into a
UDP packet (I assume) and some of the client apps have problem with that.
For example, dig will work, but will print at the beginning:
;; Truncated, retrying in TCP mode.

As I wrote, some apps, that we have little control over, cannot cope with
that. Now the question:

Can dnsmasq be made to return only a limited number of addresses? Three
would be enough, as long as they would be more or less randomly distributed
in each request.

Thanks for any ideas, how to solve this.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20170321/c20a87e6/attachment.html>

More information about the Dnsmasq-discuss mailing list