Advertisement
Guest User

Untitled

a guest
Feb 20th, 2024
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. function preresolve(dq)
  2. if (dq.qtype == pdns.A or dq.qtype == pdns.AAAA) then
  3. parent = newDN("zen.spamhaus.org")
  4. if dq.qname:isPartOf(parent) then
  5. domain = string.lower(dq.qname:toStringNoDot())
  6. local subdomain = domain:match("^(.-)%.zen%.spamhaus%.org$")
  7. local new_query_domain = subdomain .. ".xxxxx.zen.dq.spamhaus.net."
  8. dq:addAnswer(pdns.CNAME, new_query_domain)
  9. dq.rcode = 0
  10. dq.followupFunction = "followCNAMERecords"
  11. return true
  12. else
  13. return false
  14. end
  15. end
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement