RPZ explained — Response Policy Zones for protective DNS in BIND and PowerDNS
Response Policy Zones are the format the protective-DNS industry uses to move threat indicators around. If you have ever wondered how a fresh phishing domain ends up blocked across hundreds of resolvers within minutes, RPZ is usually the answer. This article explains what RPZ is, how it differs from a flat blocklist, and how SecDNS and other resolvers consume it.
What RPZ is
RPZ was created by Paul Vixie and Vernon Schryver in 2010 as a way to express resolver-side policy in the form of a normal DNS zone. The basic insight: zone transfer (AXFR/IXFR) is already a battle-tested mechanism for distributing structured DNS data, so a "firewall" can be expressed as another zone served over the same transport.
The current behaviour is described in draft-vixie-dnsop-dns-rpz. The draft never reached RFC status, but every major recursive resolver supports the format.
Triggers and actions
An RPZ rule has two halves: a trigger that selects which queries it matches, and an action that decides what the resolver does on a match.
| Trigger type | Owner-name pattern | Matches when |
|---|---|---|
| QNAME | evil.example.rpz.local | The queried name matches |
| Response IP | 32.1.2.0.192.rpz-ip.rpz.local | The answer contains that IP |
| NS Name | bad-ns.rpz-nsdname.rpz.local | The authoritative NS matches |
| NS IP | 32.1.2.0.192.rpz-nsip.rpz.local | An authoritative NS has that IP |
| Client IP | 32.1.2.0.10.rpz-client-ip.rpz.local | The querying client is in that range |
Actions are encoded as record types on the rule:
| Action | Encoded as | Effect |
|---|---|---|
| NXDOMAIN | CNAME . | Pretend the name does not exist |
| NODATA | CNAME *. | Return an empty answer |
| Passthru | CNAME rpz-passthru. | Bypass all subsequent RPZ rules |
| Drop | CNAME rpz-drop. | Silently discard the query |
| TCP-only | CNAME rpz-tcp-only. | Force the client to retry over TCP |
| Local data | Any A/AAAA/CNAME | Return a sinkhole or walled-garden address |
A minimal zone snippet:
$ORIGIN block.rpz.example.
malicious.example CNAME . ; NXDOMAIN
phishing-kit.example A 198.51.100.10 ; sinkhole
*.adserver.example CNAME *. ; NODATA
BIND and PowerDNS support
BIND exposes RPZ via response-policy { zone "block.rpz.example"; }; in named.conf. It supports policy overrides per zone, response logging, and AXFR/IXFR pull from external publishers. PowerDNS Recursor accepts RPZ via the Lua configuration or its rpzFile / rpzPrimary primitives and supports the same trigger and action vocabulary.
Both resolvers handle priority via zone order: the first matching zone in the configured list wins. This is how operators stack a "global block" feed on top of a "tenant allow" feed without losing the allow exemption.
Why protective DNS uses RPZ
Protective DNS — covered in What is protective DNS? — needs three properties out of its threat-distribution layer:
- Fast updates: IXFR delivers only the changed records, so a fresh indicator lands in seconds.
- Structured triggers: a flat domain list cannot block by NS or by response IP, which matters for taking down fast-flux infrastructure (see How DNS attacks work).
- Per-tenant overrides: stacking zones with passthru rules lets a customer allowlist a marketing domain that an upstream feed flagged as a false positive.
RPZ delivers all three out of the box, which is why nearly every commercial threat-intel vendor publishes feeds in RPZ format. SecDNS resolvers run a curated stack of RPZs from our threat research team and let customers push their own tenant-scoped zones over the API, including private indicators from an ISAC or commercial feed.
Operational considerations
A few things to remember when running RPZ at scale:
- TSIG-authenticate the AXFR/IXFR transfer so a feed cannot be hijacked.
- Cap the number of zones in the policy list; BIND lookups are linear in zone count.
- Decide ahead of time how policy hits interact with DNSSEC — most operators clear the AD bit and log the override.
- Mirror feeds into a secondary so you do not lose updates if the publisher has an outage.
Further reading
- Glossary: RPZ, DNS, protective DNS, DNSSEC
- Features: DNS over HTTPS, DNSSEC validation
- Learn: What is protective DNS?, How DNS attacks work, Why DNS filtering?