From: George Melikov Date: Tue, 5 Oct 2021 13:00:52 +0000 (+0300) Subject: powerdns-example-script.lua: clean up empty lines and spaces X-Git-Tag: dnsdist-1.7.0-alpha2~32^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F10798%2Fhead;p=thirdparty%2Fpdns.git powerdns-example-script.lua: clean up empty lines and spaces --- diff --git a/pdns/recursordist/contrib/powerdns-example-script.lua b/pdns/recursordist/contrib/powerdns-example-script.lua index 1a9cab081d..adebcb0330 100644 --- a/pdns/recursordist/contrib/powerdns-example-script.lua +++ b/pdns/recursordist/contrib/powerdns-example-script.lua @@ -50,31 +50,31 @@ function preresolve(dq) then pdnslog("Faster magic") -- compares against existing DNSName end -- sadly, dq.qname == magic2 won't work yet - + if blockset:check(dq.qname) then dq.variable = true -- disable packet cache in any case if dq.qtype == pdns.A then dq:addAnswer(pdns.A, "1.2.3.4") - dq:addAnswer(pdns.TXT, "\"Hello!\"", 3601) -- ttl + dq:addAnswer(pdns.TXT, "\"Hello!\"", 3601) -- ttl return true; end end - + if dropset:check(dq.qname) then - dq.rcode = pdns.DROP + dq.rcode = pdns.DROP return true; end - - + + if malwareset:check(dq.qname) then dq:addAnswer(pdns.CNAME, "xs.powerdns.com.") dq.rcode = 0 dq.followupFunction="followCNAMERecords" -- this makes PowerDNS lookup your CNAME return true; - end - - return false; + end + + return false; end @@ -87,13 +87,13 @@ function nodata(dq) dq.followupPrefix="fe80::" return true end - + if dq.qtype == pdns.PTR then dq.followupFunction="getFakePTRRecords" dq.followupName=dq.qname dq.followupPrefix="fe80::" return true - end + end return false end