Skip to content

Instantly share code, notes, and snippets.

@vavrusa
Created October 13, 2015 17:05
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 vavrusa/41046bdc8396fc53dbe3 to your computer and use it in GitHub Desktop.
Save vavrusa/41046bdc8396fc53dbe3 to your computer and use it in GitHub Desktop.
Small module that appends SOA for NS queries.
local mod = {}
mod.layer = {
consume = function (state, req, answer)
if state == kres.FAIL then
return state
end
answer = kres.pkt_t(answer)
req = kres.request_t(req)
if answer:qtype() == kres.type.NS then
local qry = req:push(answer:qname(), kres.type.SOA, kres.class.IN)
qry.flags = kres.query.AWAIT_CUT
end
return state
end
}
return mod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment