How to get random subset of large rrset (30+ IPs for round robin)?

Warren Kumari warren at
Fri Mar 20 14:37:40 UTC 2020

On Fri, Mar 20, 2020 at 3:14 AM David Klatt <d.klatt at> wrote:
> Hi,
> I can't find a way to do the following although I invested plenty of time
> in research - maybe you guys have an idea:
> With bind, I'd need to serve a single A record with  30+  IP addresses  and
> these addresses have to be returned in random order round robin,
> which is done with:
>     rrset-order {  order random;  };
> and records like:
>     foo  IN A
>     foo  IN A
>     foo  IN A  10.......N
> Now I'd like bind to just return a  random subset  of e.g. 5 IP addresses
> if someone requests this A record.

I realize that this is the BIND list, but this sounds like an almost
perfect example of PowerDNS's LUA record type (or something with
Other than that, the only thing I can think of is BIND with DLZ and a
database that returns a random subset from a DB query, but that sounds


> Reason for this are in my case some (thousands) older clients (that I can't control)
> that seem not being able to handle that many IPs - the OS resolver just returns an error.
> For my use case I absolutely need to make sure that each IP of that large
> A record set is given out equally (statistically) and that at any time when
> bind answers that one A record it only returns a random subset of all these IPs.
> Has someone an idea on how to achieve the latter?
> Thanks a lot in advance!
> David
> Geschäftsführer: Christoph Ostermann (CEO), Oliver Koch, Steffen Schneider, Hermann Schweizer, Tim Ulbricht.
> Amtsgericht Kempten/Allgäu, Registernummer: 10655, Steuernummer 127/137/50792, USt.-IdNr. DE272208908
> _______________________________________________
> Please visit to unsubscribe from this list
> bind-users mailing list
> bind-users at

I don't think the execution is relevant when it was obviously a bad
idea in the first place.
This is like putting rabid weasels in your pants, and later expressing
regret at having chosen those particular rabid weasels and that pair
of pants.

More information about the bind-users mailing list