From 134d3ad6ba4acf446748e82e0837248e1b9f852e Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Thu, 3 Jul 2025 15:51:21 +0200 Subject: [PATCH] Tweaks based on Miod's suggestions Signed-off-by: Otto Moerbeek --- pdns/recursordist/docs/lua-scripting/hooks.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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() -- 2.47.2