]> git.ipfire.org Git - thirdparty/pdns.git/blob - pdns/dnsdistdist/docs/advanced/luaaction.rst
d3c1f13d3003250e07e63ff5802a8cf1790f499f
[thirdparty/pdns.git] / pdns / dnsdistdist / docs / advanced / luaaction.rst
1 Lua actions in rules
2 ====================
3
4 While we can pass every packet through the :func:`blockFilter` functions, it is also possible to configure :program:`dnsdist` to only hand off some packets for Lua inspection.
5 If you think Lua is too slow for your query load, or if you are doing heavy processing in Lua, this may make sense.
6
7 To select specific packets for Lua attention, use :func:`addLuaAction` or :func:`addLuaReponseAction`.
8
9 A sample configuration could look like this::
10
11 function luarule(dq)
12 if(dq.qtype==35) -- NAPTR
13 then
14 return DNSAction.Pool, "abuse" -- send to abuse pool
15 else
16 return DNSAction.None, "" -- no action
17 end
18 end
19
20 addLuaAction(AllRule(), luarule)