What is DNS Filtering?
Written by: Lizzie Danielson
Published: 6/11/2026
Key Takeaways
- DNS filtering intercepts every domain lookup before a connection is made, quietly blocking access to malicious, phishing, and high-risk destinations without disrupting users who are following safe browsing habits.
- Because DNS sits in front of nearly every internet connection, it acts as an early, lightweight enforcement point stopping threats like C2 callbacks, malware downloads, and phishing sites before any payload is ever delivered.
- DNS filtering is not a standalone solution, it works best as a foundational layer alongside EDR, firewalls, and secure email gateways, reducing the volume of threats those heavier tools have to handle.
- Effective DNS filtering requires fresh threat intelligence, full coverage across remote and on-prem users, and integrated logging so blocked and allowed queries can feed your SIEM and incident response workflows.
- DNS filtering may reveal previously undiscovered infected devices attempting to connect to a C2.
What is DNS filtering?
DNS filtering is a security control that uses the Domain Name System (DNS) to decide which websites and services your users are allowed to reach. It blocks lookups for known malicious, suspicious, recently registered, or otherwise unwanted domains so devices on your network never connect to those domains.
How DNS works
Every time someone types a URL into a browser, clicks a link, sends an email, or an app calls an API, their device has to answer one basic question: "What IP address should I talk to?" DNS is the system that turns human-friendly names (like `huntress.com`) into IP addresses (like `104.26.7.168`) computers actually use.
In a typical flow:
- A user enters a URL or an app initiates a connection.
- The device asks a DNS resolver to look up the domain name.
- The resolver finds the right IP address and returns it.
- Only then does the browser or app connect to the server.
Nothing on the web loads until DNS finishes. That bottleneck is exactly what makes DNS such a powerful enforcement point for security.
How DNS filtering works (Step by Step)
DNS filtering doesn't change the basic DNS process—it inserts security decisions into it.
- User request
A user clicks a link or an application requests `huntress.com`.
- DNS query goes to a filtering resolver
Instead of using an ISP's resolver, the network sends DNS queries to an internal resolver that filters the DNS lookups.
- Policy and threat check
The DNS filter evaluates the requested domain against:
- Threat intelligence (known malicious or suspicious domains)
- Category data (adult content, gambling, social media, etc.)
- Your organization's policies (custom blocklists and allowlists)
- Allow or block
- If administrators allow the domain, the resolver returns the correct IP address and traffic flows normally.
- If administrators or rules block the domain, the resolver either:
- Returns no IP (so the site never loads), or
- Sends the user to a "block page" explaining that access is restricted.
- Logging and visibility
The DNS filtering server logs every decision—allowed or blocked. Those logs become valuable for incident response, threat hunting, and user behavior analysis.
This all happens in milliseconds. From a user's point of view, the only visible difference is that risky destinations quietly fail to load.
Why DNS filtering matters for cybersecurity
Because DNS sits in front of almost every internet connection, DNS filtering becomes a "first line of defense" control. It helps:
- Prevent compromise by blocking access to known malicious domains before any content is delivered.
- Contain incidents by cutting off communication to command-and-control (C2) infrastructure even if something malicious runs on an endpoint.
- Reduce user-driven risk by limiting access to high-risk categories (e.g., newly registered domains, malware-hosting sites, illegal content).
- Support compliance by enforcing acceptable use policies and logging DNS activity for audits.
Security agencies emphasize DNS-level protection for exactly these reasons. For example, the U.S. Cybersecurity and Infrastructure Security Agency (CISA) operates a protective DNS resolver for federal agencies to keep network traffic from reaching malicious destinations and to enhance visibility across their environment.
Threats DNS Filtering Helps Reduce
DNS filtering is not a silver bullet, but it is highly effective against several common threat types:
- Phishing sites: Attackers send emails or messages with links to fake login pages. If those domains are known phishing hosts or match risky patterns, DNS filtering can block them before users ever see the page.
- Malware download and distribution sites: Malicious installers and "drive‑by" download sites can be blocked at the DNS layer so endpoints never reach known payload hosts.
- Command-and-control (C2) callbacks: Many implants "phone home" to a C2 server via domain names. If those domains are on a blocklist, DNS queries fail and the malware can't receive instructions.
- Data exfiltration over DNS: Some tools and attackers encode sensitive data into DNS queries. While not every attempt can be caught, DNS filtering and monitoring can flag unusual query patterns and suspicious domains.
- DNS-based DDoS and misuse of DNS infrastructure: By steering queries away from malicious DNS infrastructure, filtering reduces exposure to some DNS amplification and reflection scenarios.
The key is keeping threat intelligence fresh and combining global feeds with your own observations from incidents and logs.
DNS filtering vs. other security controls
DNS filtering overlaps with, but does not replace, other parts of your stack:
- DNS filtering vs. web filtering / secure web gateways (SWG)
- DNS filtering makes decisions before a connection is established, based only on the domain name.
- Web filters and SWGs inspect full URLs and sometimes page content, giving more granular control (e.g., blocking specific paths on an otherwise allowed domain).
- Many modern SWGs include DNS filtering as a foundational layer.
- DNS filtering vs. firewalls
- Firewalls typically operate at the IP/port level, not the domain name level.
- DNS filtering is often simpler to deploy across distributed networks and remote users, especially when you don't fully control every egress point.
- DNS filtering vs. endpoint protection/EDR
- Endpoint controls detect and remediate malicious processes and behaviors on the device.
- DNS filtering reduces the chance those processes ever connect to malicious infrastructure, lowering overall incident volume and severity.
In practice, DNS filtering is one of several layers. It shines as an early, lightweight, and highly scalable control that relieves some of the burden placed on more advanced tools.
Where DNS filtering fits in a modern security stack
For many organizations especially small and mid-sized businesses and managed service providers (MSPs) DNS filtering is one of the most practical ways to quickly raise the security baseline:
- Central control, broad coverage: One set of DNS policies can apply across offices, remote workers, guest Wi‑Fi, and cloud workloads.
- Low friction for users and admins: There's no browser plugin for users to manage and no complex routing on day one. Most deployments start by pointing existing resolvers, firewalls, or routers at the filtering service.
- Alignment with zero trust and "internet as untrusted": DNS filtering supports the idea that all external destinations are untrusted by default and must be explicitly allowed—or at least checked—before connections are made. Government guidance on Protective DNS reflects this model for public-sector networks as well.
Limitations and common gaps
DNS filtering is powerful, but it has blind spots you need to understand:
- It can't see everything.
- If an endpoint uses a hard-coded DNS resolver or encrypted DNS that bypasses your filtering service, those queries may slip through.
- Some applications use IP addresses directly, which avoids DNS entirely.
- It depends on threat intelligence.
- Newly registered or "zero‑day" malicious domains may not be on any list yet.
- Attackers frequently rotate infrastructure to stay ahead of static blocklists.
- It doesn't inspect payloads.
- DNS filtering doesn't parse files or HTTP responses. A domain can be clean today and compromised tomorrow.
- You still need endpoint protection, email security, and network inspection where appropriate.
- Overly aggressive policies can hurt productivity.
- Blocking broad categories without input from business owners can lead to false positives and user workarounds.
Understanding these limitations helps you position DNS filtering correctly as a strong first gate, not the only one.
Best practices for implementing DNS filtering
To get real security value (and fewer headaches), focus on these practices:
- Start with a security-first baseline policy
- Block known malicious domains, malware and phishing categories, and obvious high‑risk types (e.g., command‑and‑control, newly observed domains) by default.
- Keep logs for a meaningful retention period so you can investigate incidents.
- Cover all egress paths and user populations
- Enforce DNS filtering at key points: firewalls, routers, local DNS servers, and roaming agents on laptops or mobile devices.
- Don't forget guest networks, small branch offices, and cloud workloads.
- Use both blocklists and allowlists thoughtfully
- Maintain a central process for adding exceptions so teams aren't bypassing controls ad hoc.
- Periodically review allowlists to retire entries that are no longer needed.
- Integrate DNS logs into your monitoring
- Send DNS logs to your SIEM or logging platform.
- Build simple detections around:
- High volumes of NXDOMAIN responses
- Unusual spikes in queries to rare or newly registered domains
- DNS queries from sensitive systems to unexpected TLDs
- Align with external guidance where it helps
- Follow best practices from trusted sources like CISA's guidance on Protective DNS treating DNS as a device‑centric control that protects roaming, mobile, and cloud assets, not just on‑prem networks.
- Educate users and admins
- Explain what block pages mean and how users should report issues.
- Make sure admins understand how to tune policies without over‑opening or over‑blocking.
Conclusion
DNS filtering answers a simple question "Should this domain be allowed?" at exactly the point where every connection has to pass. By enforcing policies at the DNS layer, you can quietly block access to malicious and high‑risk destinations, shrink your attack surface, and gain valuable visibility into how your users and systems interact with the internet.
For cybersecurity professionals, DNS filtering is not a replacement for firewalls, Managed EDR, or secure email gateways, but a force multiplier for all of them. When you treat it as a foundational, always‑on layer in a defense‑in‑depth strategy and pair it with good threat intelligence, logging, and user education you get a control that is both simple to operate and impactful in reducing real‑world risk.
FAQs
DNS filtering is a way to control where users and systems are allowed to go on the internet. It checks the domain name they're trying to reach against security and acceptable‑use policies, and blocks the DNS lookup if the site is known to be malicious or off‑limits.
When a user tries to visit a blocked domain, the DNS filter refuses to return a valid IP address for it (or sends them to a block page instead). Because the browser or app never gets a destination IP, it can't complete the connection and the site never loads.
No. DNS filtering makes decisions based on domain names before a connection is established. Firewalls usually work at the IP/port level, and web filters or secure web gateways can inspect full URLs and sometimes page content. DNS filtering is complementary to those tools and often used alongside them.
No, but with up-to-date threat intelligence, it can significantly reduce risk, especially for known malicious domains and common phishing campaigns. Attackers can use brand new domains, direct IP connections, or encrypted channels that bypass your DNS service. You still need layered defenses like email security, endpoint protection, and user training.
Yes. Smaller environments are frequently targeted and often have fewer people and tools to respond when something goes wrong. DNS filtering is relatively easy to deploy, inexpensive compared to many other controls, and provides immediate protection and visibility that help stretched teams stay ahead of common threats.