From 3974c8c95fc92a4c20553c50817982e75189bbf4 Mon Sep 17 00:00:00 2001 From: phonedph1 Date: Wed, 23 Oct 2024 20:19:26 -0600 Subject: [PATCH] stop using makeRule, update Qname to QName so links should work --- pdns/dnsdistdist/docs/advanced/axfr.rst | 4 ++-- pdns/dnsdistdist/docs/advanced/ebpf.rst | 2 +- pdns/dnsdistdist/docs/reference/dq.rst | 2 +- pdns/dnsdistdist/docs/reference/rules-management.rst | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pdns/dnsdistdist/docs/advanced/axfr.rst b/pdns/dnsdistdist/docs/advanced/axfr.rst index 822e7fc587..a4c104bb3c 100644 --- a/pdns/dnsdistdist/docs/advanced/axfr.rst +++ b/pdns/dnsdistdist/docs/advanced/axfr.rst @@ -21,7 +21,7 @@ The first issue can be solved by routing SOA, AXFR and IXFR requests explicitly The second one might require allowing AXFR/IXFR from the :program:`dnsdist` source address and moving the source address check to :program:`dnsdist`'s side:: - addAction(AndRule({OrRule({QTypeRule(DNSQType.AXFR), QTypeRule(DNSQType.IXFR)}), NotRule(makeRule("192.168.1.0/24"))}), RCodeAction(DNSRCode.REFUSED)) + addAction(AndRule({OrRule({QTypeRule(DNSQType.AXFR), QTypeRule(DNSQType.IXFR)}), NotRule(NetmaskGroupRule("192.168.1.0/24"))}), RCodeAction(DNSRCode.REFUSED)) .. versionchanged:: 1.4.0 Before 1.4.0, the QTypes were in the ``dnsdist`` namespace. Use ``dnsdist.AXFR`` and ``dnsdist.IXFR`` in these versions. @@ -55,7 +55,7 @@ and not the primary's one. One way to fix this issue is to allow NOTIFY from the address on the secondary side (for example with PowerDNS's `trusted-notification-proxy`) and move the address check to :program:`dnsdist`'s side:: - addAction(AndRule({OpcodeRule(DNSOpcode.Notify), NotRule(makeRule("192.168.1.0/24"))}), RCodeAction(DNSRCode.REFUSED)) + addAction(AndRule({OpcodeRule(DNSOpcode.Notify), NotRule(NetmaskGroupRule("192.168.1.0/24"))}), RCodeAction(DNSRCode.REFUSED)) .. versionchanged:: 1.4.0 Before 1.4.0, the RCodes were in the ``dnsdist`` namespace. Use ``dnsdist.REFUSED`` in these versions. diff --git a/pdns/dnsdistdist/docs/advanced/ebpf.rst b/pdns/dnsdistdist/docs/advanced/ebpf.rst index 97f4689bab..5b76b91b98 100644 --- a/pdns/dnsdistdist/docs/advanced/ebpf.rst +++ b/pdns/dnsdistdist/docs/advanced/ebpf.rst @@ -43,7 +43,7 @@ The :meth:`BPFFilter:blockQName` method can be used to block queries based on th Using the 255 (ANY) qtype will block all queries for the qname, regardless of the qtype. Contrary to source address filtering, qname filtering only works over UDP. TCP qname filtering can be done the usual way:: - addAction(AndRule({TCPRule(true), makeRule("evildomain.com")}), DropAction()) + addAction(AndRule({TCPRule(true), QNameSuffixRule("evildomain.com")}), DropAction()) The :meth:`BPFFilter:attachToAllBinds` method attaches the filter to every existing bind at runtime. It cannot use at configuration time. The :func:`setDefaultBPFFilter()` should be used at configuration time. diff --git a/pdns/dnsdistdist/docs/reference/dq.rst b/pdns/dnsdistdist/docs/reference/dq.rst index 69bd0a2bb9..7b0ede9485 100644 --- a/pdns/dnsdistdist/docs/reference/dq.rst +++ b/pdns/dnsdistdist/docs/reference/dq.rst @@ -266,7 +266,7 @@ This state can be modified from the various hooks. dq:setContent(raw) return DNSAction.Allow end - addAction(AndRule({QTypeRule(DNSQType.A), makeRule('custom.async.tests.powerdns.com')}), LuaAction(replaceQueryPayload)) + addAction(AndRule({QTypeRule(DNSQType.A), QNameSuffixRule('custom.async.tests.powerdns.com')}), LuaAction(replaceQueryPayload)) :param string data: The raw DNS payload diff --git a/pdns/dnsdistdist/docs/reference/rules-management.rst b/pdns/dnsdistdist/docs/reference/rules-management.rst index 3c70c04bff..29bd976304 100644 --- a/pdns/dnsdistdist/docs/reference/rules-management.rst +++ b/pdns/dnsdistdist/docs/reference/rules-management.rst @@ -587,7 +587,7 @@ Convenience Functions .. function:: makeRule(rule) .. versionchanged:: 1.9.0 - This function is deprecated, please use :func:`NetmaskGroupRule` or :func:`QnameSuffixRule` instead + This function is deprecated, please use :func:`NetmaskGroupRule` or :func:`QNameSuffixRule` instead Make a :func:`NetmaskGroupRule` or a :func:`SuffixMatchNodeRule`, depending on how it is called. The `rule` parameter can be a string, or a list of strings, that should contain either: -- 2.47.2