I think you may have hit the problem I ran into a while back which led to me filing this - https://github.com/PowerDNS/pdns/issues/9058
I can't see a way to get this data out of pdns as it is currently built [https://avatars2.githubusercontent.com/u/1282630?s=400&v=4]<https://github.com/PowerDNS/pdns/issues/9058> Additional data for RPZ logging/protobuf · Issue #9058 · PowerDNS/pdns · GitHub<https://github.com/PowerDNS/pdns/issues/9058> github.com In order to provide details for reporting and/or troubleshooting it would be helpful if there was an option to report the actual zone record that caused an RPZ hit. In bind syslogs you have a "via blahblah.." stanza in the log line that ... ________________________________ From: Pdns-users <pdns-users-boun...@mailman.powerdns.com> on behalf of Dave Burkholder via Pdns-users <pdns-users@mailman.powerdns.com> Sent: Friday, July 31, 2020 11:41 To: pdns-users@mailman.powerdns.com Subject: [Pdns-users] postresolve never gets rpz triggered requests I have a number of RPZs and want to log to file when an RPZ action fires. But the postresolve method doesn't have get the DNSQuestion. Here are some example log lines that don't fire an RPZ action: Jul 30 22:32:27 system pdns_recursor[4789]: washington.voip.ms. prerpz Jul 30 22:32:30 system pdns_recursor[4789]: washington.voip.ms. 10.3.5.104 rcode is 2 Jul 30 22:33:13 system pdns_recursor[4789]: get-maps-bx.g.aaplimg.com. prerpz Jul 30 22:33:13 system pdns_recursor[4789]: get-maps-bx.g.aaplimg.com. 10.3.5.119 rcode is 0 And here are lines that trigger an RPZ action. As you can see, the postresolve function never gets fired. Jul 30 22:36:12 system pdns_recursor[4789]: evidaac.com. prerpz / rcode 0 Jul 30 22:36:17 system pdns_recursor[4789]: num.to. prerpz / rcode 0 Here's my RPZ definition: rpzFile("/path/to/phishtank-online-verified/zone.conf", {defpol=Policy.Custom, defcontent="fishtank.local.blockpage.server", policyName='FishTank'}) And here's the lua script: function prerpz(dq) pdnslog(dq.qname:toString() .. ' prerpz') return false end function postresolve(dq) pdnslog(dq.qname:toString() .. " " .. dq.remoteaddr:toString() .. " rcode is " .. dq.rcode, pdns.loglevels.All) return false end Any ideas how I can configure my lua scripts to log when an RPZ action fires? Much obliged! Dave
_______________________________________________ Pdns-users mailing list Pdns-users@mailman.powerdns.com https://mailman.powerdns.com/mailman/listinfo/pdns-users