Organisations that run their own recursive resolvers already have a protective DNS control in place, but without a written policy the response policy zone (RPZ) becomes an unmanaged blocklist that nobody reviews, tunes or owns. RPZ lets a recursive resolver rewrite answers for names, addresses and name servers that match a policy zone, so malicious domains return NXDOMAIN or a walled-garden page instead of the attacker's address. This template gives network and DNS administrators numbered policy statements for feed selection, policy actions, logging and exceptions, followed by implementation guidance for BIND 9, PowerDNS Recursor and Unbound. It complements the Protective DNS Guide, which covers service models and bypass control; this page is for teams building the control themselves.
RPZ is defined in draft-vixie-dnsop-dns-rpz-00, an individual Internet-Draft whose IETF status is Expired (Informational intent, no formal standing; checked November 2026). It remains the de facto format that resolvers and feed providers implement, and the NCSC's own PDNS service stores its blocking rules as an RPZ. DNS servers are listed alphabetically throughout; order is never a ranking.
How to use this template
- Replace text in square brackets, such as [Organisation], [DNS service owner] and [24 hours], with your own roles and values. Bracketed values are illustrative.
- "Must" is mandatory; "should" is recommended practice where a documented deviation is acceptable.
- Keep server-specific syntax in a supporting runbook. The policy states what must happen; the runbook says how on your resolver.
- Read sections 3 to 6 alongside the reference tables in Implementation guidance, which explain the RPZ actions and triggers in plain terms.
RPZ in one table
| Trigger (what is matched) | Where it is encoded in the policy zone | Typical use |
|---|---|---|
| QNAME | The queried name relative to the zone apex; wildcards allowed | Known malicious and newly registered domains |
| Response IP | Under rpz-ip, reversed address prefix; matches A and AAAA answers | Domains that resolve into known bad address space |
| NSDNAME | Under rpz-nsdname; matches name server names on the delegation path | Whole infrastructures hosted on abusive name servers |
| NSIP | Under rpz-nsip; matches name server addresses | Bad name servers that change names but keep addresses |
| Client IP | Under rpz-client-ip; matches the querying client's address | Different policy for a quarantine VLAN or a test group |
1. Purpose
1.1 This policy sets the requirements for operating response policy zones on [Organisation]'s recursive DNS resolvers to prevent users, servers and devices from resolving known malicious or prohibited domains.
1.2 It aims to reduce exposure to phishing (MITRE ATT&CK T1566), malware delivery and command and control over DNS (T1071.004) or through dynamic resolution such as domain generation algorithms (T1568.002), while keeping false positives low and every block explainable.
1.3 It implements DNS denylisting (MITRE D3FEND D3-DNSDL) as part of [Organisation]'s network defence and supports CIS Controls v8.1 Safeguard 9.2, Use DNS Filtering Services.
2. Scope
2.1 This policy applies to every recursive resolver operated by or for [Organisation], including data centre, branch, cloud and operational technology resolvers, and to forwarders that send queries to them.
2.2 All managed endpoints, servers and workloads must use in-scope resolvers. Outbound DNS on TCP and UDP 53 and DNS over TLS on 853 must be blocked at the perimeter except from approved resolvers; application DNS over HTTPS must be disabled or directed to an approved resolver by policy.
2.3 Authoritative DNS servers are out of scope; RPZ applies only to recursive resolution.
2.4 Where [Organisation] also uses a commercial or government protective DNS service, local RPZ must not duplicate its blocking without reason; local zones should focus on internal intelligence, organisation-specific prohibitions and exceptions.
3. RPZ feeds and sources
3.1 Approved sources. RPZ data must come only from sources approved by [Security architecture owner]. Approved source types are:
- Commercial threat feeds: delivered as RPZ zones by zone transfer, with documented curation and false positive handling.
- Open or community feeds: allowed only after review of their inclusion criteria, update frequency and removal process.
- Internal intelligence: domains from [Organisation]'s incident response, phishing reports and threat intelligence platform, held in a locally maintained zone.
- Policy zone: domains blocked for acceptable use or regulatory reasons, kept separate from threat zones so reporting distinguishes security from policy blocks.
- Exceptions zone: PASSTHRU entries approved under section 6, listed first so it takes precedence.
3.2 Evaluation criteria. Before approval each feed must be assessed for: accuracy and false positive rate in a [14-day] log-only trial; update latency (incremental transfer and NOTIFY support); coverage relevant to [Organisation]'s sector; licensing terms; and how the provider removes entries.
3.3 Transport. Feeds must be transferred by AXFR or IXFR protected with TSIG where the provider supports it. Resolvers act as hidden secondaries for feed zones and must not serve them to other parties.
3.4 Ordering. Zones must be configured in this order: exceptions, internal intelligence, commercial feeds, open feeds, policy. In RPZ an earlier-listed zone wins when several match, so order is a policy decision and changes go through change control.
3.5 Freshness. [DNS service owner] must monitor each zone's SOA serial and alert if a feed has not updated within [24 hours] or fails to load.
3.6 Size and performance. Feed size and resolver memory must be reviewed [quarterly]; NSDNAME and NSIP triggers must be enabled only where tested for latency impact.
4. Policy actions
4.1 Each zone must have a documented default action. Feed providers may encode actions per record; [Organisation] may override them at zone level as set out below.
| Action | How the draft encodes it | What the client sees | Use under this policy |
|---|---|---|---|
| NXDOMAIN | CNAME to the root (.) | Name does not exist | Default for threat zones on servers and non-browser clients |
| NODATA | CNAME to *. | Name exists but no records of that type | Where NXDOMAIN causes application retries or noisy errors |
| Local Data (walled garden) | Any ordinary record, typically a CNAME or A record to a block page | Redirected to [Organisation]'s block page | Default for user-facing policy zones, so users see why and how to request an exception |
| PASSTHRU | CNAME to rpz-passthru. | Normal answer; later rules skipped | Exceptions zone only |
| DROP | CNAME to rpz-drop. | No response at all | Only for traffic floods or known attack infrastructure where any answer helps the attacker |
| TCP-only | CNAME to rpz-tcp-only. | Truncated UDP answer forcing a TCP retry | Not used unless approved for a specific reflection concern |
4.2 A walled-garden page must not collect credentials, must state that the request was blocked by [Organisation] security, and must give the exception request route. Walled-garden redirects break HTTPS certificate validation for the original name, so users will see a browser warning unless the block page approach is designed for it; [Organisation] must decide per zone whether NXDOMAIN or a walled garden gives the better user experience.
4.3 RPZ by default does not rewrite answers when the client sets the DNSSEC OK bit and signatures exist. Enabling the break-DNSSEC option must be an approved decision because validating clients will treat rewritten answers as bogus.
4.4 The maximum TTL of synthesised answers must be limited to [5 minutes] so that removing an entry takes effect quickly.
4.5 New zones and changed default actions must run in log-only mode (zone policy set to disabled or the server's equivalent, which logs what would have happened) for at least [7 days] before enforcement.
5. Logging and review
5.1 Every RPZ rewrite must be logged with: timestamp, client address, query name and type, matching zone, trigger, action and zone serial.
5.2 RPZ logs must be sent to [SIEM] and retained for [12 months], in line with [Organisation]'s log retention standard. See the DNS Logging and Detection Guide.
5.3 A hit from a threat zone on a server, privileged workstation or OT asset must raise an alert for triage by [Security operations] within [the incident SLA]. Repeated hits from one client must be treated as a possible infection, not as noise.
5.4 [DNS service owner] must review weekly: top blocked domains, top clients, new false positive reports and feed freshness. [Security architecture owner] must review feed value [quarterly], retiring feeds with low unique hits or high false positives.
5.5 Metrics reported monthly must include:
- Coverage: share of [Organisation]'s DNS queries that pass through RPZ-enabled resolvers.
- Hit rate by zone: threat hits per 10,000 queries per zone, and unique hits per feed.
- False positive rate: confirmed false positive exceptions per month and median time to resolve them.
- Feed freshness: hours since last successful transfer per zone, with zero tolerance for silent failures.
- Alert follow-up: share of server and privileged endpoint hits triaged within SLA.
6. Exceptions
6.1 Users and system owners may request an exception through [the service desk portal], giving the domain, business justification and requested duration.
6.2 [Security operations] must check the domain against threat intelligence before approval. Domains blocked by a threat zone may be excepted only with approval from [Security architecture owner]; policy zone blocks may be excepted by [line manager plus DNS service owner].
6.3 Approved exceptions must be added as PASSTHRU entries in the exceptions zone, scoped as narrowly as possible (exact name rather than wildcard, client IP trigger where only one group needs access), with an owner and an expiry no longer than [90 days].
6.4 Expired exceptions must be removed automatically. The exceptions zone must be reviewed [monthly] for entries without owners or with renewed justifications.
6.5 Emergency exceptions for business-critical outages may be applied by the on-call [DNS engineer] and must be ratified within [one business day].
Implementation guidance
Rolling out RPZ
- Inventory resolvers and paths: list every resolver and every route by which clients reach the internet's DNS. Coverage gaps defeat the control.
- Build the exceptions and internal zones first: create empty local zones with a real SOA (the draft notes the SOA serial drives NOTIFY and IXFR) and a placeholder NS of
localhost.. - Add one feed in log-only mode: configure it as a secondary zone with TSIG, set the zone policy to disabled or log-only, and collect at least a week of would-have-blocked data.
- Tune: review top would-be blocks with application owners, add PASSTHRU entries for confirmed business domains and agree default actions per zone.
- Pilot enforcement: enforce for a pilot client range using a client IP trigger or a separate resolver, with the service desk briefed.
- Enforce broadly and close bypasses: switch zones to enforcement, then block outbound 53 and 853 from non-resolvers.
- Rollback: keep a one-step change that sets every zone to disabled or passthru, tested, so a bad feed update can be neutralised in minutes without removing configuration.
Server support
Each of the three widely used open source recursive resolvers below documents RPZ support, including loading policy zones by zone transfer from a feed provider, zone-level action overrides and logging of rewrites. Setting names differ; the table maps the policy requirements to each server's own documentation.
| Requirement | BIND 9 | PowerDNS Recursor | Unbound |
|---|---|---|---|
| Define policy zones | response-policy statement in options, listing zones in order | rpzPrimary or rpzFile (Lua), or recursor.rpzs in YAML; zones evaluated in definition order | rpz: clause per zone, with respip added to module-config |
| Override zone action (log-only, passthru, nxdomain) | policy per zone: given, disabled, passthru, drop, tcp-only, nxdomain, nodata, cname, no-op | defpol per zone | rpz-action-override: nxdomain, nodata, passthru, drop, disabled, cname |
| Walled-garden target | policy cname with a target domain | defcontent with the Custom action | rpz-cname-override |
| Logging of hits | log per zone; rpz and rpz-passthru logging categories | Policy hits in protobuf logging, with policyName recorded as appliedPolicy | rpz-log: yes and rpz-log-name |
| Feed transfer and security | Secondary zone with TSIG keys | rpzPrimary with tsigname, tsigalgo, tsigsecret; refresh | master (AXFR and IXFR) or url |
Where commercial DNS appliances or managed DDI platforms are used, map the same requirements to the vendor's own RPZ documentation. For general resolver hardening, see BIND DNS Server Hardening and PowerDNS Security.
Precedence rules worth knowing
The draft applies matches in a fixed order: the earliest point in a CNAME chain wins, then the earlier-listed zone, then an exact name over a wildcard, then trigger type in the order Client IP, QNAME, Response IP, NSDNAME, NSIP, then the longest prefix for address triggers. Two practical consequences: the exceptions zone must be first, and a Client IP rule in a lower zone does not beat a QNAME rule in a higher zone.
Decisions for small and large organisations
- Small organisations: a single resolver pair with one commercial or government feed, an exceptions zone and NXDOMAIN as the default is enough. Consider a managed protective DNS service instead if you have roaming users and no VPN. See DNS Filtering vs Secure Web Gateway.
- Large organisations: run RPZ on internal resolvers for local intelligence and exceptions, forward to a protective DNS service for wider intelligence, and centralise zone management so every site gets the same order and serials.
- OT and air-gapped networks: an allowlist approach (D3FEND D3-DNSAL) often fits better than a denylist, using a wildcard NXDOMAIN rule with PASSTHRU entries for the few approved names.
Common failure patterns
- Silent feed failure: a transfer stops after a TSIG key change and nobody notices for weeks because the resolver keeps serving the old zone.
- Exceptions zone listed last: PASSTHRU entries never take effect because a feed higher in the order matches first.
- Bypass ignored: clients with hard-coded public resolvers or browser DNS over HTTPS never reach the RPZ resolver.
- Blocks without alerts: RPZ quietly stops a server's beacon, nobody investigates and the infected host stays in place.
- Permanent exceptions: wildcard PASSTHRU entries without expiry accumulate until they cover attacker-controlled subdomains.
Framework mapping
| Framework | Relevant entries |
|---|---|
| NIST CSF 2.0 | PR.IR-01 networks protected from unauthorised logical access; DE.CM-01 networks and network services monitored; DE.AE-03 information correlated from multiple sources |
| NIST SP 800-53 Rev. 5 | SC-7 Boundary Protection; SC-22 Architecture and Provisioning for Name/Address Resolution Service; SI-4 System Monitoring |
| CIS Controls v8.1 | Safeguard 9.2 Use DNS Filtering Services |
| ISO/IEC 27001:2022 Annex A | A.8.20 Networks security; A.8.23 Web filtering |
| MITRE ATT&CK and D3FEND | Mitigates T1566 Phishing, T1071.004 DNS and T1568 Dynamic Resolution; implements D3-DNSDL DNS Denylisting and optionally D3-DNSAL DNS Allowlisting |
References
- IETF: draft-vixie-dnsop-dns-rpz-00 DNS Response Policy Zones (RPZ)
- ISC: BIND 9 Configuration Reference
- PowerDNS: Recursor Response Policy Zones
- NLnet Labs: Unbound Response Policy Zones
- NCSC: Protective DNS (PDNS)
- CISA: Protective Domain Name System Resolver
Related NHI Mgmt Group resources: Protective DNS Guide · DNS Security Guide · D3-DNSDL DNS Denylisting · DNS Logging and Detection Guide · DNS Security and Protective DNS Buyer's Guide