Contact us
Cisco Partner

Product

DNS sinkhole: what it is, how it works and when to use one

A DNS sinkhole sends lookups for bad domains somewhere harmless that you control. It is one of the oldest DNS security techniques and still one of the most useful, especially for spotting infected devices.

  • We reply by email
  • Forever Systems, part of Forever Group

In short

A DNS sinkhole is a resolver policy that answers lookups for malicious or unwanted domains with an address you control instead of the real one, so the connection lands on a harmless server. It stops the device reaching the threat and, because each attempt is recorded, helps you find infected machines on your network.

Get a quote for DNS security

Tell us roughly how many users or sites you have and we will reply by email with options and a quote.

Contact us

What a DNS sinkhole is

When a device looks up a domain, the DNS resolver normally returns the domain's real IP address. A DNS sinkhole changes that answer for domains on a deny list. Instead of the real address, the resolver returns an address you control, so any connection the device then makes lands on a harmless server rather than on the attacker's infrastructure.

The NCSC describes the sinkhole in its guidance on protective DNS as one of the ways a protective resolver can respond to a blocked domain: the traffic is sent to a specific server to which it is redirected, and a custom response is provided there. Response Policy Zones (RPZ), the DNS firewall method the NCSC's own PDNS uses, describe the same idea as redirecting clients to a "walled garden".

You may also see the word used for a related practice: security researchers and law enforcement taking control of a malicious domain itself and pointing it at their own servers, so infected machines around the world report there instead of to the criminals. That is done at the domain level by whoever controls the domain. This page is about the version you can run for your own organisation, at your resolver.

How a DNS sinkhole works, step by step

  1. A device, or malware on it, asks your resolver for the address of a domain, for example a known command-and-control server.
  2. The resolver checks the name against its policy: a deny list built from threat intelligence, your own block list, or both. The NCSC notes that protective DNS services typically check the IP address the answer would point to as well.
  3. The domain matches, so instead of the real address the resolver returns the sinkhole address.
  4. The device connects to the sinkhole server instead. Nothing reaches the attacker.
  5. The sinkhole records the attempt and, depending on its purpose, shows a page explaining the block or simply drops the connection.
  6. Your team reviews the records, spots devices that keep trying to reach malicious domains, and investigates them.

The final step is what makes a sinkhole more than a block. Malware that is already running on a machine typically keeps trying to reach its command-and-control domain, so it keeps appearing in the sinkhole's records. Those repeated hits are a strong sign of an infection.

Sinkhole vs NXDOMAIN vs block page

A protective resolver has three main ways to answer a lookup it has decided to block. The NCSC's private-sector guidance describes all three; the right choice depends on whether you care most about the user's experience or about investigation.

ResponseWhat the resolver returnsWhat the user seesBest for
Block pageThe address of a page explaining that the domain is blockedAn explanation, but the NCSC notes this may cause a browser certificate error on HTTPS sitesStaff and pupils who need to know why a site did not load and how to ask for it to be allowed
SinkholeThe address of a server you control, which gives its own custom responseWhatever the sinkhole serves, or a failed connectionDetecting and investigating infected devices
NXDOMAIN"No such domain", the normal answer when no record existsA generic browser error; the NCSC notes users will not know the domain was blockedSilent blocking, for example of malware traffic or on guest networks

Why the certificate error? Almost every site now uses HTTPS. When a browser is sent to a block page for a domain it expected to be secure, the server answering cannot present a valid certificate for that domain, so the browser warns the user unless the device has been set up to trust a certificate issued by the filtering service. A block page is still the clearest experience; it just needs that set-up on managed devices.

In practice, a block page is itself a form of sinkholing: the blocked traffic is sent to a server the provider controls, which shows a page and records the attempt. The NCSC notes that more complex networks may want different responses for different networks, such as silently blocking with NXDOMAIN in one place and redirecting to a sinkhole in another, so check that any service you choose lets you set this per network.

Not sure which plan fits? Ask us

Tell us what you need and we will recommend the right plan for your organisation, with a quote.

Contact us

Using sinkhole hits to find infected devices

A sinkhole is only useful for investigation if you can tell which device made the request. This is where many set-ups fall short.

  • Internal DNS hides the device. If laptops ask an internal DNS server, which then forwards to a cloud resolver, the cloud service may only see the forwarding server or your office's public IP address. You need either your internal DNS logs, a component that passes the internal address on (Cisco Umbrella's virtual appliances do this, for example), or a client on the device.
  • Roaming clients identify the device. A DNS client installed on a laptop tags lookups with that device or user, so a hit points straight to the machine. See DNS roaming clients.
  • The sinkhole server can log the connection. If the sinkhole sits inside your network, it sees the internal address of each device that connects to it.
  • Repetition matters more than one hit. A single block may be a user clicking a phishing link. Repeated attempts to the same command-and-control domain, sometimes at regular intervals, point to malware on the machine.

The NCSC recommends bringing blocked DNS requests into a security information and event management (SIEM) model so they can be investigated alongside other logs, and points smaller organisations to its open-source Logging Made Easy project for basic security logging. When a device turns up, isolate it, run a full scan with your endpoint protection, check how it was infected and look for the same domain in other devices' records. Our guide to DNS attacks explains the command-and-control and data theft techniques that sinkhole hits often reveal, including DNS exfiltration.

How to set up a DNS sinkhole

There are three realistic routes. Searches for "DNS sinkhole setup" often lead to home-lab projects that build ad-blocking sinkholes on a small computer, which are fine for a home network but are not a managed, supported control for an organisation.

ApproachWhat you manageSuits
Managed protective DNS servicePolicy, allow lists and reviewing reports; the provider runs the resolvers, threat feeds and block or sinkhole serversMost organisations, including those without a dedicated security team
Your own resolver with RPZThe resolvers, their resilience, threat feeds and their updates, the sinkhole server and the loggingLarge networks with DNS specialists and existing resolver infrastructure
DNS security in your firewallFirewall subscription and policy; the vendor maintains the threat intelligenceOffices that already run a firewall with a DNS security service

A managed service is usually the quickest win: you point your networks and devices at it, and the provider maintains the deny lists, which the NCSC says should be regularly updated from threat intelligence feeds. Cisco Umbrella's security categories, for example, come from Cisco Talos threat intelligence; see Cisco DNS-layer security. Some firewalls do the same job at the gateway: WatchGuard DNSWatch, for example, blocks malicious DNS requests and redirects users to an informative page; see our WatchGuard DNSWatch guide.

Building your own with RPZ gives you full control, but the NCSC's checklist still applies: you would need to provide the threat intelligence, logging, allow-list process, resilience and protection against bypass yourself.

Is DNS security the right fit for you?

We will check it against your systems and requirements and recommend the right option.

Contact us

Limits of a DNS sinkhole

A sinkhole is a strong first layer, not a complete defence. Its blind spots are the same as those of any DNS-layer control:

  • Unknown domains get through. A sinkhole only catches domains on its lists. Newly registered domains and those created by domain generation algorithms may not be listed yet, although some providers try to block programmatically generated names.
  • Direct-to-IP connections skip DNS. Malware that connects straight to an IP address does not make a lookup.
  • Other resolvers bypass it. Devices or browsers using their own DNS, including DNS over HTTPS, do not ask your resolver. See should you block DNS over HTTPS?
  • It sees domains, not pages or files. A sinkhole cannot block one page on a legitimate site or scan a download. See DNS filtering vs URL filtering.
  • False positives happen. You need a quick way to allow a wrongly blocked domain, which the NCSC says administrators should be able to do through a user interface.

How we can help

We can help you choose and deploy managed protective DNS with sinkhole or block-page responses, connect DNS logs to their SIEM, set up the firewall and device policies that stop DNS being bypassed, and work out what repeated blocks are telling them. Contact us to talk about your network; pricing is confirmed at quote.

How Forever Systems helps with DNS security

We are an independent UK IT and cyber security provider and a Cisco Partner. We supply Cisco Umbrella and Cisco Secure Access DNS Defense, and a range of other DNS filtering options, so we can recommend what fits rather than one answer for everyone.

  • Start with what you have: we look at your firewall, endpoint protection and Microsoft 365 licences first, as some already include DNS or web filtering
  • Choosing a service: Cisco DNS-layer security, DNS filtering bundled with endpoint protection, or a protective DNS service from the public sector, compared in plain English
  • Set-up and roll-out: network forwarding, roaming clients for laptops off site, policies, block pages and controls to stop encrypted DNS bypassing the filter
  • Migration help, including planning a move from Umbrella DNS packages to Cisco Secure Access DNS Defense
  • Ongoing help: policy changes, reporting reviews, licence management and renewals, agreed at quote

We work with businesses, schools, charities and public sector organisations.

Frequently asked questions

What is a DNS sinkhole?

A DNS sinkhole is a DNS resolver policy that returns an address you control, instead of the real one, when a device looks up a malicious or unwanted domain. The device connects to a harmless server, the attack is stopped, and the attempt is recorded for investigation.

Is a DNS sinkhole the same as DNS blocking?

It is one way of doing DNS blocking. A protective resolver can answer a blocked lookup with a block page, a sinkhole address or an NXDOMAIN (no such domain) response. A sinkhole redirects traffic to a server you control, which makes it especially useful for spotting infected devices.

What is the difference between a sinkhole and NXDOMAIN?

NXDOMAIN tells the device the domain does not exist, so the user sees a generic browser error and, as the NCSC notes, will not know it was blocked. A sinkhole returns an address you control, so the connection lands somewhere you can log it and, if you choose, explain the block.

Can a DNS sinkhole find infected devices?

Yes, if you can tell which device made each request. Malware keeps trying to reach its command-and-control domain, so repeated sinkhole hits from one machine are a strong sign of infection. You need device-level visibility, from internal DNS logs, a roaming client or a sinkhole server inside your network.

Do I need to build my own DNS sinkhole?

Usually not. A managed protective DNS service includes block and sinkhole responses, maintains the threat intelligence and gives you reports. Building your own with Response Policy Zones makes sense mainly for large networks with DNS specialists who can maintain feeds, resilience and logging.

Still have a question about DNS security?

Ask us and a member of our team will reply by email.

Contact us

Next step

Want help choosing or setting up DNS security?

Tell Forever Systems what you need and we will come back to you by email with options and next steps.

  1. 1
    Tell us what you needA few lines is enough: your organisation, users or sites, and timescales.
  2. 2
    We read it and reply by emailWith options and clear next steps.
  3. 3
    You decideChoose the option that suits you and we take it from there.

DNS Security UK is a website of Forever Systems, part of Forever Group. A Cisco Partner. We supply and support several DNS security platforms, so we recommend what fits.

Send a quick enquiry

We reply by email.

About: DNS security

We only use these details to reply to your enquiry.

Talk to us about DNS security

We reply by email.

We only use these details to reply to your enquiry.
Talk to us aboutDNS security
Contact us