From: Otto Moerbeek Date: Thu, 3 Jul 2025 13:51:21 +0000 (+0200) Subject: Tweaks based on Miod's suggestions X-Git-Tag: rec-5.4.0-alpha0~43^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=134d3ad6ba4acf446748e82e0837248e1b9f852e;p=thirdparty%2Fpdns.git Tweaks based on Miod's suggestions Signed-off-by: Otto Moerbeek --- diff --git a/pdns/recursordist/docs/lua-scripting/hooks.rst b/pdns/recursordist/docs/lua-scripting/hooks.rst index a64f1c3299..2c132a59a8 100644 --- a/pdns/recursordist/docs/lua-scripting/hooks.rst +++ b/pdns/recursordist/docs/lua-scripting/hooks.rst @@ -371,9 +371,9 @@ Example script using :func:`policyEventFilter` .. code-block:: Lua - -- This is the preferred approach to modify policy decisions - -- Dont ever block my own domain and IPs - -- To make the policy engine ignore a hit instead, return true + -- This is the preferred approach to modify policy decisions. + -- Dont ever block my own domain and IPs. + -- To make the policy engine ignore a hit instead, return true. function policyEventFilter(event) if event.qname:equal("example.com") then -- replace the decision with a custom CNAME @@ -385,8 +385,8 @@ Example script using :func:`policyEventFilter` return false end -If the decision is modified in Lua hooks other than :func:`policyEventFilter` like :func:`preresolve`, ``false`` should be -returned, as the query is not actually handled by Lua. +If the decision is modified in Lua hooks other than :func:`policyEventFilter` (like :func:`preresolve`), ``false`` should be +returned, as the hook decided not to handle the query. This makes the Recursor pick up the modified decision. The policy decision is checked after :func:`preresolve` and any :func:`policyEventFilter` call. @@ -396,8 +396,8 @@ Pre-4.4.0 example script .. code-block:: Lua - -- It is preferred to use a policyEventFilter, see example above - -- Dont ever block my own domain and IPs + -- It is preferred to use a policyEventFilter, see example above. + -- Dont ever block my own domain and IPs. myDomain = newDN("example.com") myNetblock = newNMG()