[dnsdist] regexrule for ipv6-PTR-queries (ipv6-subnet)

Tom lists at verreckte-cheib.ch
Thu Oct 15 08:43:20 UTC 2020


Hi Pieter

It's working perfect with the "SuffixMatchNode" method.

Thanks.
Kind regards,
Tom


On 15.10.20 09:33, Pieter Lexis via dnsdist wrote:
> Hi Tom,
> 
> On 10/15/20 8:54 AM, Tom via dnsdist wrote:
>> I'm trying to route ipv6-ptr-queries for the net "2001:db8:7000::/36" to
>> our knot. This should cover all v6-adresses for "2001:db8:7*".
>>
>> I've configured the following regexrule:
>>
>> addAction(AndRule({RegexRule(".*\.7\.8\.b\.d\.0\.1\.0\.0\.2\.ip6\.arpa$"),
>> QTypeRule(DNSQType.PTR)}), PoolAction("knot"))
>>
>> Any hints what's wrong with the regex above? How can I catch the
>> PTR-queries for "*.7.8.b.d.0.1.0.0.2.ip6.arpa."?
> 
> No idea on what is wrong with the regex, but it is easier (and faster)
> to use a SuffixMatch here:
> 
> smn = newSuffixMatchNode()
> smn:add("7.8.b.d.0.1.0.0.2.ip6.arpa.")
> addAction(AndRule{SuffixMatchNodeRule(smn), QTypeRule(DNSQType.PTR)},
> PoolAction("knot"))
> 
> showRules l;ists thsi as:
> 
> 0           0 (qname in 7.8.b.d.0.1.0.0.2.ip6.arpa.) && (qtype==PTR)
> to pool knot
> 
> This should be exactly what you need.
> 
> Cheers,
> 
> Pieter
> 


More information about the dnsdist mailing list