Created
February 24, 2014 22:33
-
-
Save 42wim/9198691 to your computer and use it in GitHub Desktop.
PowerDNS LUA script which blocks AAAA responses to specific IP's
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function postresolve ( remoteip, domain, qtype, records, origrcode ) | |
| print ("postresolve called for: ", remoteip, getlocaladdress(), domain, qtype, origrcode) | |
| setvariable() | |
| if not matchnetmask(remoteip, {"10.100.0.0/15", "10.0.0.1/32"}) then return -1, ret end -- passthrough for "normal" ips | |
| for key,val in ipairs(records) | |
| do | |
| if val.qtype == pdns.AAAA | |
| then | |
| return 0, {} -- drop the answer if we get an AAAA | |
| end | |
| end | |
| return origrcode, records | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment