Home › Topics › DNS as a Threat Sensor › Sinkholes and Blocklists

Sinkholes and Blocklists: Using DNS to Stop Bad Destinations


So far in this topic the resolver has been a sensor: it watches, it logs, it tells you what happened. This guide is about giving it a second job. Because nearly every connection on your network starts by asking the resolver for a name, the resolver is also a checkpoint. If it declines to answer for a name you know is bad, or answers with an address you control, the connection that would have followed simply never happens. You need no new hardware, no inline appliance, no rewriting of firewall rules for every fresh piece of bad news. One list on one server, and the whole network stops going there.


You will learn how resolver-side blocking works. You will learn the different ways a resolver can say "no" and what each costs you. You will learn why sending blocked names to a sinkhole turns a block into a tripwire that identifies infected or misconfigured clients. You will learn what protective resolver services do and when to use one. You will learn how to maintain lists without breaking the business, and how to measure whether any of it is worth the effort. This guide assumes you have query logging in place, because a block you cannot see is a block you cannot learn from. The guide turning your resolver into a sensor covers that.


In this guide

  • The resolver as a checkpoint
  • The ways a resolver can say no
  • The sinkhole as a tripwire
  • Protective resolver services
  • Maintaining the lists
  • When a block breaks something: the exception path
  • Measuring the value
  • The sinkhole-response checklist
  • Where to go next

The resolver as a checkpoint


A resolver normally answers whatever it is asked, either from cache or by going and finding out. A response policy inserts one step before that: check the requested name against a list. If it matches, return the answer the policy specifies instead of the real one. Most resolver software supports some form of this, whether called a response policy zone, a filtering rule set, a block list, or simply "DNS security." Firewalls and network appliances that act as resolvers usually have an equivalent feature. The mechanism differs; the idea is identical.


The list is a blocklist: names, and sometimes whole domains including every subdomain, that you never want your clients to reach. Alongside it lives an allowlist: names that must always resolve normally no matter what any blocklist says, which is your safety valve against mistakes. The policy checks the allowlist first, then the blocklist, then falls through to normal resolution. Keep that order in mind; it is what makes a fast exception possible later.


Two honest limitations before you get attached to the idea. First, resolver blocking only affects clients that use your resolver, so it is only as complete as your firewall rules that force them to. A client that resolves names elsewhere walks straight past the checkpoint. Second, it blocks by name. Software that connects directly to an address, without ever asking DNS, is not affected. Neither is a reason not to do it, since the vast majority of both people and malicious software go through names. But these limitations are why the resolver is one layer and not the only one.


The ways a resolver can say no


When a name matches the blocklist, the policy has to answer with something. The choice matters more than people expect, because it decides what the user sees, what the client does next, and what you learn.


MechanismWhat the client getsProsCons
NXDOMAIN"No such name"Simple; clients give up cleanly; no infrastructure neededLooks identical to a typo, so users report "the site is down" and you learn nothing beyond the query log
Empty answer (no data)The name exists but has no addressAlso simple; some software handles it more gracefully than NXDOMAINSame visibility problem; a few clients retry aggressively
Refuse or dropAn error, or silence and a timeoutClear signal in the client's own error messageTimeouts make applications hang; silence looks like a broken resolver and generates tickets against you
Sinkhole addressAn address you control, inside your networkEvery client that then connects identifies itself; you can serve a block page for web traffic; strongest detection valueNeeds a small host and firewall rules; must be maintained; can confuse non-web software
Block page via sinkholeA web page saying "blocked, here is why, here is who to contact"Users understand what happened and how to request an exception; fewer mystery ticketsOnly works for plain web traffic; encrypted sites show a certificate warning before your page, which confuses people

For a first deployment, NXDOMAIN is the least surprising choice and the one most resolvers default to. It is also the one that teaches you least. Once the basics are stable, move the blocklist's answer to a sinkhole, because the sinkhole is where a block becomes a detection.


The sinkhole as a tripwire


A sinkhole is an address on your network that does nothing except accept connections and write them down. When the policy answers a blocked name with the sinkhole's address, a client that only looked the name up stops there. In that case, a client that wanted to connect goes ahead and connects to the sinkhole. That distinction is the whole value. A lookup might be a browser prefetching a link nobody clicked or a security agent checking a reputation. A connection is intent. The sinkhole's connection log is a list of machines that actually tried to reach a destination you had already decided was bad, each one raising its hand.


Building one is modest work:


  • A small host with a fixed internal address runs listeners on the common ports (web, secure web, and whatever else you want to observe). Those listeners accept a connection and record the source address, port, timestamp, and, for plain web traffic, the requested hostname and path. Then they close the connection. The host should never serve real content and never answer with anything an attacker's software could interpret as instructions.
  • A serious firewall posture around it. The sinkhole receives connections from possibly infected machines all day. Allow inbound from client subnets on the listening ports only. Deny everything outbound except log shipping. Keep it patched. Treat it as hostile territory rather than a trusted server.
  • Log shipping to your collector, so sinkhole connections land next to the query log and firewall log where you can correlate them. The query log says who asked; the sinkhole log says who followed through.
  • An optional block page on the web listener. It converts a confusing failure into a clear message and gives people a route to request an exception. That quietly reduces the number of tickets that say "the Internet is broken."

Here is what the pairing looks like once both logs land in the same collector, in an illustrative generic layout. First the resolver, then the sinkhole a moment later:


# query log
11:42:07.114 client=10.20.4.88  qname=cdn-update.badhost.example qtype=A rcode=NOERROR answer=10.99.0.5 policy=blocklist-threat list=feed-a
11:42:07.120 client=10.20.4.88  qname=cdn-update.badhost.example qtype=AAAA rcode=NOERROR answer=- policy=blocklist-threat list=feed-a
11:43:52.601 client=10.20.7.19  qname=cdn-update.badhost.example qtype=A rcode=NOERROR answer=10.99.0.5 policy=blocklist-threat list=feed-a

# sinkhole log (10.99.0.5)
11:42:07.388 src=10.20.4.88 dport=443 proto=tcp host=cdn-update.badhost.example
11:57:07.402 src=10.20.4.88 dport=443 proto=tcp host=cdn-update.badhost.example
12:12:07.395 src=10.20.4.88 dport=443 proto=tcp host=cdn-update.badhost.example

Two clients asked for the blocked name. Only one of them connected, and it keeps connecting every fifteen minutes with nobody at the keyboard. That tells you it is software, not a person. The other client looked the name up once and never followed through, which is what a prefetch or a reputation check looks like. Without the sinkhole you would have two equally suspicious query-log entries; with it you have one machine to visit today and one to note.


A client that appears in the sinkhole log needs a look, but it does not automatically need a rebuild. Some connections are misconfigurations. Examples include an old bookmark, or a script pointing at a retired service that landed on a list. Another is a device phoning home to a manufacturer whose domain was blocked. Other connections are the real thing. The response checklist at the end of this guide walks through telling them apart.


Tip: point the sinkhole address at nothing you care about. Reusing a real server "because it is already there" means an attacker's software will be sending its traffic to a machine that does real work. One day it will be a machine you cannot afford to isolate. A tiny dedicated host is cheaper than that day.


Protective resolver services


Maintaining a good blocklist is real work, and there is an honest shortcut: protective resolver services. These are resolvers operated by someone else that apply their own continuously updated blocklists to every query. You point your internal resolvers' forwarders at them. And every lookup your resolver cannot answer from its own zones or cache gets checked against a list you never have to maintain. Bad names come back blocked; everything else resolves normally.


The tradeoffs are worth stating plainly. In exchange for the list maintenance, you send every external name your network resolves to a third party. That is a privacy and dependency decision to make consciously. Record it in the same policy document that covers your query logs. You have less control over what is on the list and less insight into why something was blocked. And their block answer is usually a plain NXDOMAIN or their own address, not your sinkhole. And if the service is unreachable, your resolution is too, so configure a fallback and monitor it.


The arrangement that works well for small teams is layered. A protective upstream does the heavy lifting. A small local policy on your own resolver handles the things only you know about. Your local blocklist holds the domains you found in your own hunts, the names from your own incidents, and anything your organization has decided is unacceptable. Your local allowlist overrides the upstream when it blocks something your business needs. Local policy is checked first, so your decisions always win.


Maintaining the lists


A blocklist is a living thing. Left alone it grows stale in both directions. New bad names are missing, and old entries block domains that have long since been cleaned up or re-registered by someone innocent. A maintenance routine keeps it useful.


Sources

Entries arrive from three places. Published threat lists, from public projects, industry groups, or a paid feed, provide breadth. Pick a small number you trust rather than every list you can find. That is because overlapping lists multiply false positives without adding much coverage. Your own findings from the weekly hunt and from incidents provide precision: the names that were actually seen on your network. And organizational policy provides the rest: categories your workplace has decided to block regardless of threat.


Update cadence

Automate the published lists on a schedule (daily is a common rhythm) and have the update fail safely. If a download breaks, keep the last good copy rather than loading an empty list or, worse, a half-downloaded one. Reload the resolver's policy gracefully so clients never see a gap. Local entries are added by hand, immediately, whenever a hunt or an incident produces one. Each addition gets a note saying who added it, when, and why.


Hygiene

Periodically review the local list and remove entries whose reason has expired. Watch the size of the combined list; very large lists slow some resolvers and are harder to reason about. And keep everything under version control or at minimum dated backups. That way, "what changed on the day the finance app broke" is a question with an answer.


When a block breaks something: the exception path


It will happen. A published list will include a domain your payroll provider uses for a background service. Or your own hunt will block a name that turns out to be a vendor's telemetry endpoint. And a business application will quietly stop working. The damage is not the block; it is the hour it takes to figure out that the block is the cause. Then there is the second hour it takes to find someone who can undo it. Design the exception path before you enable blocking:


  • Make blocks visible. Use a block page and a distinctive entry in the query log. Add a note in the help desk's playbook that says "if a site has stopped working, check the block log first." Most of the hour vanishes here.
  • Decide who can approve an exception and how quickly, including outside business hours. For a small team this is usually "any of two named people, within the hour, by adding to the allowlist."
  • Prefer temporary exceptions with a review date, so a name added in a hurry does not live on the allowlist forever.
  • Allowlist narrowly. The one hostname the application needs, not the whole domain, and never a wildcard "just to be safe."
  • Feed the correction back. If a published list caused it, report the false positive to its maintainers. If your own entry did, note what you learned so the next hunt does not repeat it.

Roll out blocking in stages for the same reason. Use log-only mode first, where the policy records what it would have blocked without actually blocking. A week of that report tells you exactly which business systems you are about to break. Then enforce for a small group, then for everyone.


Measuring the value


Blocking that nobody measures gets switched off the first time it inconveniences someone important. Measurement is how you defend it, and the query log plus the sinkhole log make it easy:


  • Blocks per week, by category. Which lists are doing the work? A list that never matches anything is dead weight. A list that matches constantly is either valuable or noisy. And a glance at what it blocked tells you which.
  • Clients that hit the sinkhole. The number that connected, not merely looked up. Track it per week and keep the list of repeat visitors. A machine that reappears every week is a machine nobody has fixed.
  • Time from finding to block. When a hunt or an incident produces a bad name, how long until every client is protected from it? Minutes is achievable with a local list. If it is days, the process, not the technology, needs work.
  • Exceptions requested and granted. A rising count means the lists are too aggressive or the business changed. A count of zero after a year probably means people gave up asking.

Report these as aggregates. "Blocked forty attempts to reach known-bad domains this week; three clients connected to the sinkhole and were remediated" is a sentence a manager understands and a privacy officer does not object to.


The sinkhole-response checklist


A client has connected to the sinkhole. Work through these steps in order, and write down what you find at each one.


StepDo thisYou are trying to learn
1. Identify the clientMap the address to a hostname and an owner via DHCP, inventory, or directoryWorkstation, server, device, or unknown? A user who can be asked, or an unattended system?
2. Identify the nameFind the query-log line that preceded the connection; check which list it matched and why the entry existsMalicious destination, policy category, or a stale entry that should be removed?
3. Look at the connectionRead the sinkhole log: port, timing, and for web traffic the requested path and any headersA browser with a human behind it, or software connecting on a schedule with no user present?
4. Establish the timelineSearch the query log for the client-and-name pair as far back as retention allowsWhen did this start, and does it repeat at a regular interval?
5. Look for companySearch all clients for the same name and for the address it originally resolved toIs this one machine, or the first of several?
6. Check the other logsFirewall, proxy, and endpoint logs around the start time and around a few connectionsOther new destinations, new processes, other signs of compromise?
7. Decide and actMisconfiguration: fix and note it. Stale entry: remove it. Compromise: isolate the client, preserve it, escalate through incident responseAn outcome recorded well enough that the next person can learn from it
8. Close the loopAdd any newly discovered names to the local blocklist; tune the allowlist if a false positive was involved; update the weekly metricsThe block got smarter because of this event

Where to go next


Your resolver is now both a sensor and a checkpoint. It records every lookup, refuses the ones you have decided are bad, and, through the sinkhole, tells you which clients tried anyway. You know the tradeoffs between the ways of saying no. You know when to lean on a protective upstream and when to keep decisions local. You know how to keep the lists honest, and how to handle the inevitable morning when a block breaks payroll. The names that feed your local list come from watching the log for tunneling patterns and beaconing and generated names. And the weekly hunting workflow makes that watching a habit. All the guides in this topic are collected at DNS as a Threat Sensor.


Put this into practice with SysPeep Monitor

A sinkhole, a policy-enabled resolver, and a protective upstream are three more things that can quietly fail. A failed resolver is an outage, not a security event. SysPeep Monitor checks that your DNS servers and sinkhole host stay reachable and healthy. It provides dependency-aware alerting so one dead resolver does not page you about every client behind it. The free trial runs on any Windows machine.

Download Free TrialLearn About SysPeep