Skip to content

Instantly share code, notes, and snippets.

@ahupowerdns
Created January 19, 2016 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahupowerdns/01ecbdd2d2ab0f8ea99d to your computer and use it in GitHub Desktop.
Save ahupowerdns/01ecbdd2d2ab0f8ea99d to your computer and use it in GitHub Desktop.
adservers=newDS()
adservers:add(dofile("blocklist.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:addRecord(pdns.SOA,
"fake."..dq.qname:toString().." fake."..dq.qname:toString().." 1 7200 900 1209600 86400",
2)
return true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment