← Back to Learning Hub

DNS • Intermediate • 6 min read

DNS REFUSED (RCODE 5): Causes and Fixes

REFUSED (RCODE 5) means a reachable nameserver declined to answer. Causes include recursion disabled, ACL or view restrictions, a zone not served, and rate limiting.

REFUSED is DNS response code 5, and it means something specific: the nameserver received your query, understood it, and chose not to answer. That makes it fundamentally different from the other failure responses. NXDOMAIN (RCODE 3) says a name does not exist. SERVFAIL (RCODE 2) says the server tried and something went wrong, often DNSSEC validation. REFUSED says the server is healthy and reachable but is declining, almost always because of a policy decision: it is not willing to do what you asked for the client you are. That framing points straight at the handful of causes worth checking.

Spotting REFUSED in a query

You see the status in the header of a dig answer:

dig @ns1.example.com example.com A
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 43127
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

The status: REFUSED line is the signal, and the empty answer and authority sections confirm the server gave you nothing. Because the server did respond, the problem is not connectivity; it is what the server decided about your query. Querying a specific nameserver by address like this, rather than going through your default resolver, is the key diagnostic move, because REFUSED often depends on which server you ask and from where.

Cause 1: recursion is disabled for your client

The most common REFUSED is asking an authoritative-only nameserver to do recursion. Authoritative servers answer for the zones they host; they are not meant to resolve arbitrary names for the public, and most are configured to refuse recursive queries from clients outside their network. If you point a general query at a domain's authoritative nameserver and expect it to resolve some unrelated name, you will get REFUSED. That is correct behavior, not a fault.

The fix depends on what you actually wanted. If you need to resolve a name, send the query to a recursive resolver (your ISP's, or a public one like 1.1.1.1 or 8.8.8.8), not to an authoritative server. If you are testing whether an authoritative server holds a zone, query it for a name inside that zone specifically, which it will answer authoritatively without needing recursion.

Cause 2: ACLs and views restrict who may ask

Resolvers and authoritative servers alike can be configured with access control lists that only accept queries from certain source addresses. A recursive resolver meant for an internal network will REFUSE queries arriving from the public internet, which is both normal and desirable, since an open resolver can be abused for amplification attacks. BIND views (and the equivalent in other servers) take this further, presenting different answers, or refusing entirely, based on the client's source address.

If you are hitting REFUSED from a resolver you expect to serve you, check that your source address is inside its allow-query list. From the server operator's side, confirm the ACL includes the networks that legitimately need access and excludes everyone else. Testing from a known-good source network, or directly on the server's own network, quickly reveals whether an ACL is the cause.

Cause 3: the server does not serve that zone

A nameserver will REFUSE an authoritative query for a zone it does not actually host. This bites during migrations and delegation changes: the parent delegation (the NS records at the TLD) still lists a nameserver that has already had the zone removed, or a secondary that never successfully loaded it. Clients follow the delegation to that server, ask for the zone, and get REFUSED because the server has no such zone configured. The symptom is intermittent resolution, failing whenever a resolver happens to pick the server that lost the zone.

The fix is to align the delegation with reality: make sure every nameserver listed in the parent's NS set, and in the zone's own NS records, is actually configured and serving the zone, and remove any that are not. Reading the delegation and querying each listed nameserver in turn pinpoints which one is refusing.

Cause 4: rate limiting and abuse controls

Some servers return REFUSED when a client exceeds a query-rate threshold or trips an abuse rule, as a lighter-weight alternative to dropping traffic outright. If REFUSED appears only under load or only from a busy source, and clears when the rate drops, a rate limit or query-policy control is the likely cause. Reduce the query rate, or if you operate the server, confirm the limits are tuned for legitimate traffic.

Localizing the problem

Because REFUSED depends on which server you ask and who is asking, the investigation is mechanical: query each authoritative nameserver for the zone directly and note which ones answer and which refuse, then repeat from a different network if you suspect an ACL. The Valla DNS lookup lets you query specific record types and read the authoritative answer, so you can see which nameservers in a delegation respond cleanly and which are the ones returning nothing, narrowing a REFUSED to the exact server and policy at fault.

Frequently asked questions

What is the difference between REFUSED and SERVFAIL?

SERVFAIL (RCODE 2) means the server tried to answer and failed, often a DNSSEC validation failure or an unreachable upstream. REFUSED (RCODE 5) means the server deliberately declined, usually due to recursion being off for you, an ACL, a zone it does not serve, or rate limiting.

Why do I get REFUSED from a domain's own nameserver?

You are probably asking it to resolve a name outside the zones it hosts. Authoritative servers refuse recursive queries from outside clients. Query it only for names inside its own zones, or send recursive lookups to a recursive resolver instead.

REFUSED happens sometimes but not always. Why?

Resolvers pick among a zone's nameservers, so intermittent REFUSED usually means one listed nameserver no longer serves the zone while the others do. Check each nameserver in the delegation individually and remove or fix the one that refuses.

Can REFUSED be caused by my own network?

Indirectly, yes. If a resolver restricts queries to certain source networks and yours is not on the list, it will refuse you. Test from a network that is supposed to have access, or use a public recursive resolver to confirm the name resolves at all.

How do I find which nameserver is refusing?

Query each authoritative nameserver by address for a name in the zone and read the status line. A DNS lookup tool that targets specific records and shows the authoritative response makes it easy to see which servers answer and which return REFUSED.

REFUSED is a policy answer, not a broken one: a reachable server declining your specific query. Work out whether it is recursion, an ACL, a missing zone, or a rate limit by querying the nameservers directly, and use the Valla DNS lookup to pinpoint exactly which server in the delegation is turning you away.

Troubleshooting box

If results look inconsistent, compare authoritative nameservers first, then recursive resolvers by region. Capture snapshots every 10 minutes for deterministic incident timelines.

Try VallaDNS free →

Intermediate • 6 min

Fix ERR_NAME_NOT_RESOLVED in Your Browser

ERR_NAME_NOT_RESOLVED means the browser could not turn a hostname into an IP. Separate a missing record from a stale cache, a down resolver, or a typo, and fix each.

Intermediate • 6 min

What Is TLS-RPT? Reading TLS Reporting Reports

TLS-RPT publishes a _smtp._tls TXT record so receivers send you daily JSON reports on successful and failed TLS sessions. Learn what the reports contain and how to act on them.