Skip to main content

Matcher Plugins

Matcher plugins return true or false. They are mainly used by sequence.matches.

Runtime Modes

Matchers declared in plugins: with stable tags can be inspected and switched among three modes for the current runtime:

Mode$matcher!$matcher
normalUse the matcher resultNegate the matcher result
always_falseMissMatch
always_trueMatchMiss

Both fixed modes skip the internal predicate and fix its base Boolean value, but every reference still applies its own outer negation. The WebUI requires confirmation for both fixed actions; restoring normal does not require confirmation.

The runtime mode is shared by matcher tag, while reference semantics remain local to each reference. If the same tag appears as $matcher and !$matcher in one or more sequences, both references share the fixed base value but their final results remain opposites. Child references in any_match follow the same rule; control the any_match tag itself when the entire composition must be fixed.

This state is not written to the configuration, and a full reload or process restart restores normal. Quick-setup matchers do not have stable public tags and therefore do not expose runtime modes; extract the expression into a standalone matcher when control is required. See the Plugin Extension APIs for endpoint details.

Matcher Expression Rules

Inside sequence, quick-setup matcher expressions are usually the clearest form to start with:

- matches:
- "client_ip $lan_ip_set"
- "qtype A,28"
exec: "$forward_main"

Other quick-setup matchers can be combined in the same way:

- matches:
- "qname domain:example.com"
- "qclass IN,3"
exec: "$forward_main"

Negation:

- matches: "!has_resp"
exec: "$forward_main"

Category map

GroupPlugins
Request Matchersqname, question, qtype, qclass, client_ip, ptr_ip
Response Matchersresp_ip, cname, rcode, has_resp, has_wanted_ans
Context and Policymark, env, time, random, rate_limiter
Composition and Constantsany_match, string_exp, _true, _false

Legacy plugin anchors remain on this directory page; field references now live in the responsibility groups above.