Skip to content
AdminKit

Is your DNS resolver an open resolver?

An open DNS resolver answers recursive queries from any client on the internet, not just its intended users, which attackers abuse to flood a spoofed victim with amplified replies; AdminKit's DNS lookup tool checks any domain's own records, and an external dig test shows whether your own resolver answers strangers.

By AdminKit team, Netbase JSC · Updated

Key takeaways

  • A resolver is open when it performs recursive lookups for any client on the internet instead of only for its own users.
  • The harm lands on someone else: spoofed queries turn the resolver’s larger replies into a flood aimed at a victim.
  • The test is one dig command run from outside the network the resolver serves. A real answer means open; REFUSED or a timeout is what you want.
  • The fix is an access list (Unbound access-control, BIND allow-recursion), plus turning recursion off on servers that are only meant to be authoritative.

What makes a resolver “open”?

A recursive resolver is the DNS server a client actually asks, tracking an answer down through the root, TLD and authoritative servers on the client’s behalf. It becomes an open resolver the moment it answers that same recursive query for any client on the internet, not just the network or users it was built to serve. RFC 5358, published as BCP 140 and also tracked in the IETF Datatracker, recommends operators restrict recursive service to intended clients only — through access control lists or authentication — rather than leaving it open by default. Its closing recommendation is short: by default, name servers should not offer recursive service to external networks.

It helps to separate the two jobs a DNS server can do, because “answers queries from anyone” is correct for one of them and a problem for the other:

Server roleWho it should answerWhat “open to the internet” means
Authoritative serverAnyone, but only for the zones it hostsNormal and required: the world has to be able to look up your domain
Recursive resolverOnly its own clients (a LAN, a VPN, an ISP’s customers)A misconfiguration: strangers can use it to look up any name
Forwarder (for example a router’s DNS proxy)Only devices on the local networkSame problem as an open resolver, because it relays any query upstream

A single machine running both roles is where this usually goes wrong: the server must answer the world for its own zones, and the recursion setting quietly follows the same “answer everyone” rule.

Why does an open resolver matter if nobody is attacking you?

An open resolver’s real danger isn’t that strangers can look things up through it — it’s that an attacker can send it a query with a victim’s IP address spoofed as the source, and the reply (often much larger than the request) floods the victim instead of the attacker. The resolver operator typically only sees an unexplained spike in outbound query traffic, not that their server was used as a weapon against someone else. CISA’s advisory on DNS amplification attacks documents exactly this pattern as a popular form of DDoS and recommends operators identify and close open recursive resolvers as a mitigation. This depends on source-address spoofing working at all, which is the separate problem BCP 38 (RFC 2827) addresses by filtering forged source addresses at the network edge — closing either gap (open recursion or spoofable source addresses) helps prevent the attack.

The traffic pattern looks like this (addresses from the documentation ranges):

attacker (sends with forged source 198.51.100.7)
   |  small query, asking for a large record set
   v
open resolver 203.0.113.10   <- answers anyone
   |  large reply, sent to the forged source address
   v
victim 198.51.100.7           <- receives replies it never asked for

RFC 5358 puts a number on the leverage: with EDNS0, which allows DNS replies larger than the classic 512-byte limit, the ratio of response size to query size “could be around 80”. Multiply that across many open resolvers and a small number of attacking machines can produce far more traffic than they send. The same RFC notes why this goes unnoticed: each resolver handles a modest number of packets, so no single operator sees a change in its own traffic that stands out.

How do open resolvers end up on the internet?

Very few people set out to run a public resolver. RFC 5358 traces the problem to history: some name server software once shipped with defaults that, when used for recursion, answered every host on the internet, and small networks are the most likely to keep shipped defaults. The patterns worth ruling out on your own network are:

  • One server doing both jobs. An authoritative server for your zones also has recursion enabled, so the “answer anyone” rule for your zones covers recursion too.
  • A resolver listening on every interface. A caching resolver or forwarder on a cloud VM or a router binds to all addresses, including the public one, and nothing restricts who may ask.
  • A port forward for port 53. A NAT rule sends inbound DNS to an internal resolver that was only ever meant for the LAN.
  • An access list that is too wide. Someone allows 0.0.0.0/0 or ::/0 while debugging and never narrows it again, or allows IPv4 carefully and forgets IPv6.

How do you check a resolver you operate?

Test from a host outside the network the resolver is meant to serve — querying it from inside that network will always get an answer and tells you nothing about what the rest of the internet sees:

dig @203.0.113.10 example.com +short

A real answer back means the resolver responded to a client it had no business serving — that’s an open resolver. No answer, a REFUSED status, or a timeout is the result you want. If you manage more than one resolver or a resolver with multiple interfaces, repeat this from a couple of distinct external vantage points, since some misconfigurations only expose recursion on one network path rather than globally. Test every public address the server has, IPv4 and IPv6 alike.

Pick a test name the server is not authoritative for. If the box also hosts your own zone, asking it for your own domain returns an authoritative answer whether recursion is open or closed, which proves nothing. A name in someone else’s zone, such as the reserved example.com, can only be answered through recursion (or from a cache filled by recursion), so an answer there is the signal that matters.

Run the command without +short to see the header flags as well. The two outcomes look like this (illustrative output from dig 9.18, trimmed; documentation addresses):

; open: recursion offered and an answer returned
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37350
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; ANSWER SECTION:
example.com.        300     IN      A       192.0.2.80

; closed: the server refuses a client outside its access list
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 15494
;; flags: qr rd; QUERY: 0, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available
What you see from outsideWhat it meansWhat to do
NOERROR, an answer, and the ra flagOpen resolver: recursion is offered to strangersRestrict it now (next section)
REFUSED, no ra flagRecursion is closed to your vantage pointRepeat from other networks and over IPv6
Timeout or “no servers could be reached”Filtered by a firewall, or the server is downConfirm from inside that it is running, so the timeout reflects the firewall
An answer only for your own zone, without raAuthoritative-only server behaving normallyNothing; this is the correct behaviour for that role

How do you fix an open resolver?

Restrict recursive query answers to your own known client networks using an access control list, rather than leaving the default “answer everyone” configuration in place. RFC 5358 lists the ways a server can recognise its intended clients: by source address (an access list), by the interface the query arrived on (useful on broadband routers with an embedded resolver), by TSIG or SIG(0) signatures for roaming clients, or by having mobile users run a local cache or a VPN to a trusted server. Separate authoritative and recursive roles onto different servers if a single box is currently doing both, since an authoritative server generally should answer anyone for the zones it hosts, while a recursive resolver generally should not.

In the two most common open-source resolvers the access list looks like this (example networks; replace them with your own):

# Unbound (unbound.conf)
server:
    access-control: 192.0.2.0/24 allow
    access-control: 2001:db8:10::/48 allow
    # anything not matched is refused by default

# BIND 9 (named.conf)
acl "internal" { 192.0.2.0/24; 2001:db8:10::/48; localhost; };
options {
    recursion yes;
    allow-recursion { internal; };
    allow-query-cache { internal; };
};

The Unbound reference states that the most specific matching netblock wins and that a client matching no access-control line is refused, so the order of the lines does not matter. The BIND 9 reference says that when neither allow-recursion, allow-query-cache nor allow-query is set, recursion is limited to localnets and localhost. An open BIND resolver therefore usually means one of those statements was widened to any. On an authoritative-only BIND server, recursion no; removes the question entirely.

After any change, reload the server and run the external dig test again. Then repeat it after upgrades and configuration rollouts, because a template or a new interface can reopen what you closed.

Which AdminKit tools help, and where do they stop?

AdminKit’s DNS resolver test page covers a related but different question than this guide: which resolver is actually answering your own device’s queries, which helps catch a DNS leak or a hijacked router — see is my router’s DNS hijacked for that use case. It does not audit whether a resolver you operate answers the entire internet’s queries, so the external dig test above is the practical self-check for that. AdminKit’s DNS lookup tool is useful once you’ve locked recursion down, to confirm your own domain’s records resolve the way you expect through a resolver you trust.

What should you check after closing it?

This same spoofed-source amplification pattern isn’t unique to DNS — how to check if port 123 (NTP) is exposed covers the NTP equivalent. If you run the network edge as well as the resolver, source-address filtering (BCP 38) removes the spoofing step that every one of these reflection attacks needs. If you’re reviewing mail infrastructure, see how to publish and test MTA-STS, and for a different DNS hygiene risk entirely, see how to find a dangling CNAME. All of these sit in AdminKit’s DNS cluster alongside the live tools and glossary terms that back them.

This guide is general information, not a security audit of your specific network — see our disclaimer for what AdminKit's guidance does and does not commit to.

Frequently asked questions

What exactly makes a resolver 'open'?

A resolver is open when it answers recursive DNS queries from any client on the internet, rather than only the network or users it was meant to serve. RFC 5358 (also published as BCP 140) recommends operators restrict recursive DNS service to intended clients only, through access control lists or authentication, instead of leaving it open to the whole internet.

Why is an open resolver dangerous even if I'm never the attacker's real target?

The resolver itself becomes a weapon: an attacker sends it a query with a victim's IP address spoofed as the source, and the reply — which can be much larger than the request — floods the victim instead of the attacker. The resolver operator usually only notices unusual outbound traffic, not that their server was used against someone else. BCP 38 (RFC 2827) addresses the other half of this problem, filtering forged source addresses at the network edge so the spoofing step doesn't work in the first place.

How do I test whether a resolver I operate is open?

From a host outside the network the resolver is meant to serve, run `dig @<resolver-ip> example.com +short`. If you get a real answer back, the resolver answered a query from an unrecognized external client — the definition of open. Run it from more than one external vantage point if you can, since some misconfigurations only expose recursion to certain networks rather than the whole internet.

Does AdminKit have a tool that checks this?

Not a dedicated one. AdminKit's DNS resolver test page (/tools/dns-resolver-test/) covers a related but different question — which resolver is actually answering your own device's queries, useful for catching a DNS leak or hijack. It does not audit whether a resolver you operate answers the whole internet's queries; the external `dig` test above is the practical self-check for that, and AdminKit's DNS lookup tool is useful afterward to confirm your own domain's records resolve as expected once recursion is locked down.

Want AdminKit to watch this for you?

Free checks tell you the state today. Protective DNS and monitoring tell you when it changes.

Huy Nguyen (David), Founder and CEO of Netbase JSC

Talk to an expert

Huy Nguyen (David), Founder & CEO, Netbase JSC

Ask whether this fix applies to your setup, or get a second pair of eyes on your DNS and mail records.