Lua actions in rulesΒΆ
While we can pass every packet through the blockFilter()
functions, it is also possible to configure dnsdist to only hand off some packets for Lua inspection.
If you think Lua is too slow for your query load, or if you are doing heavy processing in Lua, this may make sense.
To select specific packets for Lua attention, use addAction()
with LuaAction()
, or addResponseAction()
with LuaResponseAction()
.
A sample configuration could look like this:
function luarule(dq)
if(dq.qtype==35) -- NAPTR
then
return DNSAction.Pool, "abuse" -- send to abuse pool
else
return DNSAction.None, "" -- no action
end
end
addAction(AllRule(), LuaAction(luarule))