]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: Give an example Lua record accessing qname. 13406/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 20 Oct 2023 10:55:48 +0000 (12:55 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 20 Oct 2023 10:55:48 +0000 (12:55 +0200)
Also mention qtype is not a thing in Lua records.
Fixes #8443

docs/lua-records/index.rst

index 109954ac61240cc463ba9ca1f2a166c7b7ea7892..4028feb65c7a1ea5e55845a7b9ccfe1de227fda4 100644 (file)
@@ -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
 -------------------------------------------