Explain plugin execution flow, priorities, and common plugin types:
queryplugins (manipulate DNS queries/responses)execplugins (side-effecting tasks)flowplugins (control flow)
- Plugin types:
- Query plugins operate on request/response path and may return a DNS response.
- Exec plugins perform side-effecting actions (such as update ipset, download files).
- Flow plugins control execution (such as jump/goto/return semantics).
- Plugin factory / builder: registration mechanism that allows plugins to be discovered and built from configuration.
- Datasets: text-based domain and IP lists used by dataset plugins; support for auto-reload and merging of files/inline expressions.
This sequence shows a typical plugin chain where hosts provides immediate answers, cache handles cached responses, and forward sends queries to upstream resolvers when needed.
Client
|
v
[Listener]
|
v
[Request Handler]
|
v
+--------------------------+
| Plugin: hosts | => If match -> Respond (short-circuit)
+--------------------------+
|
v
+--------------------------+
| Plugin: cache | => If cached -> Respond
+--------------------------+
|
v
+--------------------------+
| Plugin: forward | => Query upstream and return response
+--------------------------+
|
v
Response -> Client
This pipeline is intentionally simple: listeners hand requests to a single handler which executes an ordered set of plugins. Plugins may short-circuit the pipeline by producing a response (such as hosts or cache) or let the request continue to upstreams.
Short pages or subsections for major plugins with purpose & example config:
forward: forward queries to upstreamscache: hierarchical cache with TTL handling and LazyCachehosts: static hosts mappingacl: allow/deny by client IPgeoip: IP-based country tagging (GeoIP)geosite: domain category tagging (GeoSite)cron: scheduled background jobs (HTTP, command, invoke-plugin)dataset.*: domain/ip setsdomain_set: domain matching dataset (full/domain/regexp/keyword)ip_set: extract A/AAAA addresses and materialize ipset entries
sequence:Sequence plugin, a rule-based executor to compose plugins into chainsexecutable.*: exec-style plugins (downloader, ipset, nftset)arbitrary: return predefined DNS records for matching queriesblackhole: return configured A/AAAA answers (sinkhole aliases)collector: simple in-process query counter; optional Prometheus collector when built withmetricsfeaturedebug_print: log queries/responses for debuggingdownloader: download remote files and atomically update local filesdrop_resp: clear any existing response in the execution contextdual_selector: filter answers by IPv4/IPv6 preferenceecs: prepare EDNS0 Client Subnet options (ECS)edns0opt: add arbitrary EDNS0 options for upstream queriesfallback: try child plugins in order with automatic failoveripset(exec): materialize A/AAAA answers into ipset entriesmark: set lightweight metadata marks on the requestnftset: materialize A/AAAA answers into nftables setsquery_summary: build and store a concise request summaryrate_limit: per-client rate limitingredirect: rewrite query names (supports wildcards)reverse_lookup: cache A/AAAA -> name mappings and answer PTRros_addrlist: RouterOS address list helper and notifiersleep: pause execution for a durationttl: fix or clamp TTL values on responses
plugins:
- tag: cache
type: cache
config:
min_ttl: 30How priorities and plugin lists affect execution.
TODO: Link each built-in plugin to deeper docs pages.