DNS Filtering & Policy Introductory 6 min read

How DNS Filtering Works

A conceptual explanation of how DNS filtering fits into the DNS resolution process, and what is actually happening when a domain is blocked.

Updated August 22, 2026

DNS filtering is often described as a way to block websites. That phrasing is convenient, but misleading. DNS filtering doesn’t block network traffic or inspect content. It changes how DNS resolution behaves when a query matches a defined policy.

Everything people experience as a “blocked domain” follows from that one intervention inside the normal resolution process. The mechanism is identical whether the policy exists for content enforcement or for DNS security. Only the rules differ.

DNS resolution before filtering is applied

In a typical environment, an application asks the operating system to resolve a name, and the OS stub resolver sends the query to its configured recursive resolver.

The recursive resolver checks its cache, answers from it if it can, and otherwise resolves the name by querying other DNS servers. At this stage DNS is only answering a naming question. No connection has been attempted and no application data has moved.

Where DNS filtering fits into resolution

DNS filtering isn’t a separate protocol or a special operating mode. It’s a set of policy checks applied by a recursive resolver or DNS forwarding component during resolution, usually at one of two points:

  • Before the resolver attempts to resolve the name externally
  • Before a cached answer is returned to the client

In both cases the input is the query itself: the name, the query type, and sometimes context about the client. If the query is allowed, resolution continues normally. If it’s denied, the resolver deliberately changes the outcome of the lookup.

Conceptual DNS filtering decision point inside recursive resolution
Figure 1: DNS filtering is a policy decision inside the recursive resolver workflow.

Policy at the DNS layer

Policy at this layer evaluates domain names, never web content or application behavior. Typical inputs are the queried domain or subdomain, pattern matches on labels, categorization or reputation metadata, and context such as network, user, or device identity.

A policy might deny every subdomain of malware-distribution.net, or deny any domain an external classification feed categorizes as gambling. None of this exists in the DNS protocol. It lives entirely at the resolver or forwarding layer, and it varies by environment and implementation. How those rules express an organization’s acceptable use policy, and where DNS controls fit into compliance frameworks, are subjects of their own.

How a resolver enforces a deny decision

DNS defines no standard way to say “this domain is blocked.” A resolver that denies a query must still return something that fits DNS semantics:

  • NXDOMAIN, indicating the name doesn’t exist
  • An error code such as REFUSED or SERVFAIL
  • No response at all
  • An address that isn’t the original destination

Each carries tradeoffs. NXDOMAIN can trigger fallback behavior the operator didn’t intend. Silent failure imitates a network problem. A substituted address preserves resolution but changes where the client connects next.

RFC reference
The DNS protocol defines response codes such as NXDOMAIN and REFUSED, but doesn't define blocking semantics. Those decisions are applied by resolver policy, not by the protocol itself, as specified in RFC 1034 and RFC 1035.

Sinkholing as a DNS response pattern

When a resolver returns an address that intentionally leads somewhere other than the requested destination, that’s sinkholing. From a DNS perspective it’s simply answer substitution, a different IP address than the authoritative server would have provided.

DNS has no concept of redirection or intent. It returns records. What happens next depends entirely on how clients and applications use the result.

What happens after DNS returns an answer

Once the response is returned, DNS is finished. The resolver plays no part in connection setup, encryption, or application behavior. What users see next depends on how applications interpret the result:

  • NXDOMAIN may surface as “site not found”
  • A substituted address may lead to a reachable service
  • An error or timeout may look like a network failure

In some environments the substituted address hosts an informational page explaining the policy decision. That page is delivered by a web service, not by DNS.

Case example
A user opens a browser and navigates to a domain categorized as gambling. The recursive resolver matches the query against policy, returns a sinkholed address, and the browser connects to that address instead of the original server. If the sinkhole serves a block page over HTTP, the user sees an explanation. If the original request was HTTPS, the browser may show a certificate error because the sinkhole server can't present a certificate the browser trusts for the blocked domain.

Why HTTPS complicates blocked domains

When a client connects to a substituted address over HTTPS, the server it reaches must still present a certificate valid for the original domain. If it can’t, the browser warns or refuses outright. That behavior belongs to TLS validation, not to DNS filtering.

Did you know?
A DNS filter can return any IP address it wants, but it can't forge a TLS certificate. This is why blocked HTTPS sites often show certificate errors rather than block pages, unless the client is configured to trust a CA that issues certificates for the blocked names.

The same policy decision can therefore look completely different depending on protocol, application, and client behavior: a clean block page in one case, a certificate warning in another, an apparent outage in a third.

The limits of DNS filtering

DNS filtering acts at the earliest moment of the connection lifecycle, deciding whether a client learns an address for a name and which address it learns. That position is its power. The decision lands before the application opens a connection to the destination.

It’s also the boundary. DNS filtering can’t inspect application content, modify traffic in transit, or enforce anything after a connection is established. Those jobs belong to other layers of a security stack.

Summary

DNS filtering applies policy during normal resolution. It evaluates name queries and deliberately alters responses when the rules say so. What people perceive as a “blocked domain” is that altered response interacting with applications, encryption, and client behavior downstream.

Understanding where DNS stops and other layers begin is the key to understanding both the power and the limits of filtering at the DNS layer.