]> granicus.if.org Git - pdns/commitdiff
our recursor lua policy override example did not work
authorbert hubert <bert.hubert@powerdns.com>
Tue, 15 May 2018 12:33:25 +0000 (14:33 +0200)
committerbert hubert <bert.hubert@powerdns.com>
Tue, 15 May 2018 12:33:25 +0000 (14:33 +0200)
pdns/recursordist/docs/lua-scripting/hooks.rst

index f3fb6915d268f9a04cb31b724d1a1d49749168fa..29a196df9fc9a30269327f619f7a358dc86e99c8 100644 (file)
@@ -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: