Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
adservers=newDS()
adservers:add(dofile("blocklist.lua"))
-- optionally: adservers:add(dofile("trackers.lua"))
filterset=newCAS()
filterset:add(dofile("filtercustomers.lua"))
function preresolve(dq)
if(not adservers:check(dq.qname) or (dq.qtype ~= pdns.A and dq.qtype ~= pdns.AAAA)) then
return false
end
dq.variable=true
if(not filterset:check(dq.remoteaddr)) then
return false
end
dq:addRecord(pdns.SOA,
"fake."..dq.qname:toString().." fake."..dq.qname:toString().." 1 7200 900 1209600 86400",
2)
return true
end
@seitzbg

This comment has been minimized.

Copy link

@seitzbg seitzbg commented Aug 11, 2017

Can something similar be done with dnsdist, or is it not meant for that ?

TIA!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment