[dnsdist] about addPoolRule() performance

Wang Jian larkwang at gmail.com
Tue May 10 16:22:48 UTC 2016

2016-05-10 23:48 GMT+08:00 Remi Gacogne <remi.gacogne+dnsdist at powerdns.com>:
> Hi,
> On 05/10/2016 04:27 PM, Wang Jian wrote:
>> The thing is, there can be huge performance difference too, if the
>> domain set is large and hash table lookup is used. I look through code
>> and think current implementation doesn't use hash table lookup. Am I
>> correct? If so, I suggest adding hash table lookup.
> Thank you for your suggestion. dnsdist is currently using a
> SuffixMatchNode, which is roughly a tree of DNS labels. Along other nice
> properties it allows sub-domain matching, which would not be easily
> possible with a hash table.
> --
> Remi Gacogne
> PowerDNS.COM BV - https://www.powerdns.com/

Hi Remi,

I think hash table can be used. For example, we want to search
www.level2.example.com matches in { google.com, facebook.com }. In
hash table, google.com and facebook.com are keys.

Then, we lookup www.level2.example.com, then level2.example.com, then
example.com, then com. A level hint can be specified, i.e.
match_level_hint=2, then search stops at example.com.

And hash table can be hinted too,  use_hash=1 (default 0)

Of course, lookup badexample.com in { google.com, facebook.com,
example.com } as a match is impossible. But by using hash table here,
you explicitly exclude this case.


More information about the dnsdist mailing list