COREDNS-ACL(7)
πΈ COREDNS-ACL(7) β the acl plugin, explained by your favorite Unix girlie πΈ
ok so this is the manual page for acl, one of the CoreDNS plugins (yes, CoreDNS Plugins is the whole family, hi π). Pull up a chair bestie, we're doing access control today.
β¨ NAME β¨
acl β it enforces access control policies on source ip and prevents unauthorized access to DNS servers. that's it, that's the vibe check. π‘οΈ
π DESCRIPTION π
okay so with acl enabled, you can block or filter suspicious DNS queries by configuring IP filter rule sets β like, allowing the authorized queries and blocking the unauthorized ones. literally a bouncer for your DNS. πͺβ¨
When evaluating the rule sets, acl uses the source IP of the TCP/UDP headers of the DNS query received by CoreDNS. and ngl this is the part people get confused about, so listen up: this source IP will be different than the IP of the client originating the request in cases where the source IP of the request is changed in transit. for example:
- if the request passes though an intermediate forwarding DNS server or recursive DNS server before reaching CoreDNS
- if the request traverses a Source NAT before reaching CoreDNS
so yeah, it's giving "whoever's handing me the packet" not "whoever started the whole thing." π
Also: this plugin can be used multiple times per Server Block. slay. π
π SYNTAX π
acl [ZONES...] {
ACTION [type QTYPE...] [net SOURCE...]
}
ZONESβ zones it should be authoritative for. If empty, the zones from the configuration block are used.ACTIONβ can beallow,block,filter, ordrop, and it defines the way to deal with DNS queries matched by this rule. The default action isallow, which means a DNS query not matched by any rules will be allowed to recurse. The difference betweenblockandfilteris thatblockreturns status code ofREFUSEDwhilefilterreturns an empty setNOERROR.drophowever returns no response to the client β literally leaves them on read π.QTYPEβ the query type to match for the requests to be allowed or blocked. Common resource record types are supported.*stands for all record types. The default behavior for an omittedtype QTYPE...is to match all kinds of DNS queries (same astype *).SOURCEβ the source IP address to match for the requests to be allowed or blocked. Typical CIDR notation and single IP address are supported.*stands for all possible source IP addresses.
π₯ EXAMPLES π₯
To demonstrate the usage of plugin acl, here we provide some typical examples. it's a little buffet of configurations, take what you need bestie π
Block all DNS queries with record type A from 192.168.0.0/16οΌ
. {
acl {
block type A net 192.168.0.0/16
}
}
Filter all DNS queries with record type A from 192.168.0.0/16οΌ
. {
acl {
filter type A net 192.168.0.0/16
}
}
Block all DNS queries from 192.168.0.0/16 except for 192.168.1.0/24οΌ
. {
acl {
allow net 192.168.1.0/24
block net 192.168.0.0/16
}
}
Allow only DNS queries from 192.168.0.0/24 and 192.168.1.0/24οΌ
. {
acl {
allow net 192.168.0.0/24 192.168.1.0/24
block
}
}
Block all DNS queries from 192.168.1.0/24 towards a.example.orgοΌ
example.org {
acl a.example.org {
block net 192.168.1.0/24
}
}
Drop all DNS queries from 192.0.2.0/24οΌ
. {
acl {
drop net 192.0.2.0/24
}
}
π METRICS π
If monitoring is enabled (via the prometheus plugin) then the following metrics are exported β it's giving observability, we love to see it β¨
coredns_acl_blocked_requests_total{server, zone, view}β counter of DNS requests being blocked.coredns_acl_filtered_requests_total{server, zone, view}β counter of DNS requests being filtered.coredns_acl_allowed_requests_total{server, view}β counter of DNS requests being allowed.coredns_acl_dropped_requests_total{server, zone, view}β counter of DNS requests being dropped.
The server and zone labels are explained in the metrics plugin documentation. go read that one next, iykyk π¦
ok that's the whole page!! no cap, you now know acl better than most people. go filter something (responsibly) π
signing off β this was CoreDNS, March 2026 edition, straight from the CoreDNS plugin docs squad π«Άπ
π¦ where this page comes from
- nixpkgs unstable: coredns 1.14.7
- opensuse-leap 16.0: coredns-extras 1.15.0-bp160.1.1 Β· Apache-2.0 AND MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms