Skip to content

Instantly share code, notes, and snippets.

@vavrusa
Created Oct 13, 2015
Embed
What would you like to do?
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