From: bert hubert Date: Tue, 15 May 2018 12:33:25 +0000 (+0200) Subject: our recursor lua policy override example did not work X-Git-Tag: dnsdist-1.3.1~96^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F6609%2Fhead;p=thirdparty%2Fpdns.git our recursor lua policy override example did not work --- diff --git a/pdns/recursordist/docs/lua-scripting/hooks.rst b/pdns/recursordist/docs/lua-scripting/hooks.rst index f3fb6915d2..29a196df9f 100644 --- a/pdns/recursordist/docs/lua-scripting/hooks.rst +++ b/pdns/recursordist/docs/lua-scripting/hooks.rst @@ -272,13 +272,14 @@ Example script myDomain = newDN("example.com") myNetblock = newNMG() - myNetblock:addMasks("192.0.2.0/24") + myNetblock:addMasks({"192.0.2.0/24"}) function preresolve(dq) if dq.qname:isPartOf(myDomain) and dq.appliedPolicy.policyKind ~= pdns.policykinds.NoAction then pdnslog("Not blocking our own domain!") dq.appliedPolicy.policyKind = pdns.policykinds.NoAction end + return false end function postresolve(dq) @@ -294,6 +295,7 @@ Example script end end end + return false end .. _snmp: