SecDNS

RPZ explained — Response Policy Zones for protective DNS in BIND and PowerDNS

A practical guide to Response Policy Zones, the de-facto firewall format for DNS resolvers, covering trigger types, BIND and PowerDNS support, and why protective DNS providers rely on RPZ.

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 typeOwner-name patternMatches when
QNAMEevil.example.rpz.localThe queried name matches
Response IP32.1.2.0.192.rpz-ip.rpz.localThe answer contains that IP
NS Namebad-ns.rpz-nsdname.rpz.localThe authoritative NS matches
NS IP32.1.2.0.192.rpz-nsip.rpz.localAn authoritative NS has that IP
Client IP32.1.2.0.10.rpz-client-ip.rpz.localThe querying client is in that range

Actions are encoded as record types on the rule:

ActionEncoded asEffect
NXDOMAINCNAME .Pretend the name does not exist
NODATACNAME *.Return an empty answer
PassthruCNAME rpz-passthru.Bypass all subsequent RPZ rules
DropCNAME rpz-drop.Silently discard the query
TCP-onlyCNAME rpz-tcp-only.Force the client to retry over TCP
Local dataAny A/AAAA/CNAMEReturn 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:

  1. Fast updates: IXFR delivers only the changed records, so a fresh indicator lands in seconds.
  2. 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).
  3. 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

Frequently asked questions

Is RPZ a standard?

RPZ originated as a BIND extension by Paul Vixie and Vernon Schryver in 2010 and is documented in an informational draft (draft-vixie-dnsop-dns-rpz). It is not an IETF standards-track RFC, but it is widely implemented and is the de-facto interchange format for resolver-side threat feeds.

What is the difference between RPZ and a blocklist?

A blocklist is a flat list of domains. An RPZ is a regular DNS zone that uses naming conventions to encode trigger type and action — for example, returning NXDOMAIN, redirecting to a sinkhole, or returning a CNAME to a walled-garden page. RPZ also supports IP, NS-name and client-IP triggers, which a plain blocklist cannot express.

Which resolvers support RPZ?

BIND, PowerDNS Recursor, Knot Resolver and Unbound (via auth-zone plus rpz-style policy modules) all support some form of RPZ. SecDNS accepts RPZ uploads through its API so customers can bring their own feeds.

Can I subscribe to public RPZ feeds?

Yes. Spamhaus, SURBL, ThreatSTOP and several ISACs publish RPZ feeds either openly or behind a paid subscription. They are typically delivered as zone transfers (AXFR/IXFR) over TSIG-authenticated TCP.

Does RPZ break DNSSEC?

RPZ rewrites by definition produce answers the original zone owner did not sign, so a strictly validating downstream cannot get an AD bit on rewritten responses. Resolvers handle this by clearing AD on policy hits and, in some configurations, refusing to apply RPZ to DNSSEC-signed responses unless the operator opts in.