Policy Events

Since 4.4.0, the Lua hook policyEventFilter() is called along with a PolicyEvent object whenever a filtering policy matches.

PolicyEvent class

class PolicyEvent

Represents an event related to a filtering policy.


Add policyTag tag to the list of policyTags.

Parameters:tag (str) – The tag to add
:getPolicyTags() → {str}

Get the current policy tags as a table of strings.


Set the policy tags to tags, overwriting any existing policy tags.

Parameters:tags ({str}) – The policy tags

Skip the filtering policy (for example RPZ) named policyname for this query.

Parameters:policyname (str) – The name of the policy to ignore.

The decision that was made by the policy engine, see Modifying Policy Decisions and DNSQuestion.appliedPolicy for the attributes of PolicyEvent.appliedPolicy.


DNSName of the name the query is for.


Type the query is for as an integer, can be compared against pdns.A, pdns.AAAA.


Whether the query was received over TCP.


ComboAddress of the requestor.