[rbldnsd] Multiple Answers only sometimes
furio ercolessi
furio at spin.it
Sun Nov 18 23:15:43 MSK 2007
On Sun, Nov 18, 2007 at 08:05:32PM +0100, Manfred Hielder wrote:
> > .. Internally, ip4set composed of 4 arrays. Each range with
> > size /32../25 is added to first array. Each range with
> > size /24../17 - to second. /16../9 - to 3rd, and /8../1
> > to 4th. This is in more-or-less natural granularity, because
> > in DNS IP addresses and ranges are separated by octets
> > (4 for an address). Rbldnsd searches all the arrays and
> > stops on first match - usually it's appropriate because
> > only most specific entry is the most interesting one.
> > ...
> tnx for this knowledge.
> > For things like in your case, more natural representation
> > is ip4trie - because all entries are CIDRs without fancy
> > ranges, and there aren't that many of them. For ip4trie,
> > rbldnsd will ONLY return the most specific entry -- always.
> OK
> > ..If that's not what's needed, i.e, you really want ALL entries
> > to be returned instead of only the most specific one, --
> > with current code it's not possible, but it's trivial to
> > implement in rbldnsd_ip4trie.c - about 5 lines of code,
> > in ds_ip4trie_query() routine. The only problem with that
> > is how to control whenever one wants most specific or all
> > entries to be returned.
>
> For this task i would need every matching line. It would be great if
> you could provide the "about 5 lines of code" ;-)
> The other task will run the standard version.
There is another trick to return everything, that does not require
any new code. You split your dataset, say 'bl', in four separate
datasets (separate files):
'bl1' containing only /8 thru /1 listings
'bl2' containing only /16 thru /9 listings
'bl3' containing only /24 thry /17 listings
'bl4' containing only /32 thru /25 listings
then you combine them in a single zone in the usual way
rbldnsd ... bl.zone:ip4set:bl1 bl.zone:ip4set:bl2 \
bl.zone:ip4set:bl3 bl.zone:ip4set:bl4
This trick was suggested to me by mjt many years ago, as
an alternative to writing about 5 lines of code :-)
furio
More information about the rbldnsd
mailing list