Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function preresolve(dq)
- if (dq.qtype == pdns.A or dq.qtype == pdns.AAAA) then
- parent = newDN("zen.spamhaus.org")
- if dq.qname:isPartOf(parent) then
- domain = string.lower(dq.qname:toStringNoDot())
- local subdomain = domain:match("^(.-)%.zen%.spamhaus%.org$")
- local new_query_domain = subdomain .. ".xxxxx.zen.dq.spamhaus.net."
- dq:addAnswer(pdns.CNAME, new_query_domain)
- dq.rcode = 0
- dq.followupFunction = "followCNAMERecords"
- return true
- else
- return false
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement