From 7fca2a514ea92cae5cdbe7e726eab8637bb150c2 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Fri, 20 Oct 2023 12:55:48 +0200 Subject: [PATCH] auth: Give an example Lua record accessing qname. Also mention qtype is not a thing in Lua records. Fixes #8443 --- docs/lua-records/index.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 ------------------------------------------- -- 2.47.2