From: Otto Moerbeek Date: Fri, 20 Oct 2023 10:55:48 +0000 (+0200) Subject: auth: Give an example Lua record accessing qname. X-Git-Tag: rec-5.0.0-rc1~17^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7fca2a514ea92cae5cdbe7e726eab8637bb150c2;p=thirdparty%2Fpdns.git auth: Give an example Lua record accessing qname. Also mention qtype is not a thing in Lua records. Fixes #8443 --- diff --git a/docs/lua-records/index.rst b/docs/lua-records/index.rst index 109954ac61..4028feb65c 100644 --- a/docs/lua-records/index.rst +++ b/docs/lua-records/index.rst @@ -80,7 +80,15 @@ LUA records can also contain more complex code, for example:: www IN LUA A ";if countryCode('US') then return {'192.0.2.1','192.0.2.2','198.51.100.1'} else return '192.0.2.2' end" -As you can see you can return both single string value or array of strings. +As you can see you can return both single string value or array of strings. + +An example Lua record accessing ``qname``:: + + *.example.net 10 IN LUA TXT "; return 'Got a TXT query for ' .. qname:toString() .. '; First label is: ' .. qname:getRawLabels()[1]" + +``qtype`` cannot be accessed from a Lua script, the value is fixed per Lua record. +See :doc:`functions` for available variables. + Using LUA Records with Generic SQL backends -------------------------------------------