From: Wim Date: Mon, 1 Aug 2016 21:19:02 +0000 (+0200) Subject: Fix some inconsistencies X-Git-Tag: rec-4.0.2~37^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F4268%2Fhead;p=thirdparty%2Fpdns.git Fix some inconsistencies --- diff --git a/docs/markdown/recursor/scripting.md b/docs/markdown/recursor/scripting.md index ac3291ad85..82ba30aded 100644 --- a/docs/markdown/recursor/scripting.md +++ b/docs/markdown/recursor/scripting.md @@ -224,8 +224,8 @@ nmg:addMask("127.0.0.0/8") nmg:addMasks({"213.244.168.0/24", "130.161.0.0/16"}) nmg:addMasks(dofile("bad.ips")) -- contains return {"ip1","ip2"..} -if nmg:match(dq.remote) then - print("Intercepting query from ", dq.remote) +if nmg:match(dq.remoteaddr) then + print("Intercepting query from ", dq.remoteaddr) end ``` @@ -364,17 +364,17 @@ The following script will add a requestor's IP address to a blocking set if they sent a query that caused PowerDNS to attempt to talk to a certain subnet. This specific script is, as of January 2015, useful to prevent traffic to ezdns.it related -traffic from creating CPU load. This script requires PowerDNS Recursor 3.7 or later. +traffic from creating CPU load. This script requires PowerDNS Recursor 4.x or later. ``` lethalgroup=newNMG() lethalgroup:addMask("192.121.121.0/24") -- touch these nameservers and you die function preoutquery(dq) --- print("pdns wants to ask "..remoteip:tostring().." about "..domain.." "..qtype.." on behalf of requestor "..getlocaladdress()) + print("pdns wants to ask "..dq.remoteaddr:toString().." about "..dq.qname:toString().." "..dq.qtype.." on behalf of requestor "..dq.localaddr:toString()) if(lethalgroup:match(dq.remoteaddr)) then --- print("We matched the group "..lethalgroup:tostring().."!", "killing query dead & adding requestor "..getlocaladdress().." to block list") + print("We matched the group "..lethalgroup:tostring().."!", "killing query dead & adding requestor "..dq.localaddr:toString().." to block list") dq.rcode = -3 -- "kill" return true end