DNS failures: NXDOMAIN, SERVFAIL and timeouts
Your browser says the site can’t be found. Whether the name doesn’t exist, is blocked, has broken DNS or your resolver is down, with a command that tells them apart.
3 min read
On this page
"This site can't be reached." "Check if there is a typo." Browsers show much the same page for quite different faults. We tested, and Chrome gave the identical error for a name that doesn't exist and one that does. DNS itself is more precise: it answers with a code.
Ask for the code
dig +noall +comments ckip.net | grep statusOn Windows:
Resolve-DnsName ckip.netnslookup ckip.net works everywhere, and gives the reason in words: "Non-existent domain", "Server failed", "Query refused", "timed out".
Find where it goes wrong
- 1Your resolverWhat does it say?
- 2Another resolverDoes it say the same?
- 3Without checkingDoes it work if signatures are ignored?
- 4The sourceWhat do the site’s own servers say?
Where the answers start to differ is where the fault is.
1 and 2: your resolver and another
dig ckip.net +shortdig ckip.net @1.1.1.1 +shortdig ckip.net @8.8.8.8 +shortnslookup ckip.netnslookup ckip.net 1.1.1.1nslookup ckip.net 8.8.8.8- Yours fails and the others work: your resolver. Restart the router, or set another resolver. On a company network, ask first: some names exist only there.
- All fail in the same way: the name itself. Go on.
- All time out: your network blocks DNS to outside servers, or there's no connection at all. Try
ping 1.1.1.1.
If your system's answer differs from what the browser does, the browser may be using its own encrypted DNS.
Is it blocked?
A filter often answers NXDOMAIN, or gives an address such as 0.0.0.0, for names it doesn't want you to reach. Parental controls, security products, ad blockers, providers and some public resolvers do this. Signs of it: another resolver gives an ordinary answer, and the reply looks unusual. Quad9's refusal to answer a test name shows both:
dig +noall +comments isitblocked.org @9.9.9.9 | grep -E 'status|recursion';; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 13243;; WARNING: recursion requested but not availableA resolver normally offers recursion. Quad9 leaves that flag off when it blocks a name, and it adds an extended code, 17, which RFC 8914 defines as "Filtered". If a name is blocked on a network that isn't yours, that's a decision by whoever runs it.
3: without checking signatures
SERVFAIL often means that the domain's DNSSEC signatures don't match. Resolvers that check them refuse the answer. Ask again without checking:
dig +cd +short www.dnssec-failed.org @1.1.1.168.87.109.24269.252.193.191With +cd there's an answer and without it there isn't, so the signatures are the problem. Cloudflare's web interface even states the reason:
curl -s -H 'accept: application/dns-json' 'https://cloudflare-dns.com/dns-query?name=www.dnssec-failed.org&type=A'{"Status":2,"TC":false,"RD":true,"RA":true,"AD":false,"CD":false,"Question":[{"name":"www.dnssec-failed.org","type":1}],"Comment":["EDE(9): DNSKEY Missing no SEP matching the DS found for dnssec-failed.org."]}Don't work around it by choosing a resolver that doesn't check. The check exists so that a forged answer can't send you to the wrong place, and you can't tell a mistake from an attack. Tell the site's owner.
If it fails with +cd too, the domain's name servers are unreachable or misconfigured.
4: the source
Find the domain's own name servers and ask one directly:
dig +short NS ckip.netdig +noall +answer ckip.net @arturo.ns.cloudflare.comnslookup -type=NS ckip.netnslookup ckip.net arturo.ns.cloudflare.com- They answer correctly: resolvers may have an old answer stored. Wait for it to expire.
- They don't answer or answer REFUSED: a fault at the site's DNS provider, or the domain points at the wrong servers.
- There are no name servers: the domain may have expired. Check it with a WHOIS lookup; expired domains go through several stages.
"It exists now, but I still get NXDOMAIN"
"Doesn't exist" is stored too. How long is set by the domain, in the last number of the record that comes with the answer (RFC 2308):
dig +noall +authority this-name-does-not-exist.ckip.net @1.1.1.1ckip.net. 1800 IN SOA arturo.ns.cloudflare.com. dns.cloudflare.com. 2420023439 10000 2400 604800 1800Here it's 1,800 seconds: for half an hour, a name that you looked up before creating it may still seem not to exist. So create the record first and look it up afterward. Clearing your own cache doesn't clear the resolver's, although Cloudflare and Google both have a page for purging a name from theirs.
Clear your own cache
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderipconfig /flushdnsClose the browser as well, since it has a cache of its own. Check the hosts file for a forgotten line: /etc/hosts, or C:\Windows\System32\drivers\etc\hosts.
If nothing resolves at all
- Does
ping 1.1.1.1work? If it doesn't, it isn't DNS: start with the connection. - Turn off the VPN. Some leave their DNS server set after they quit.
- On hotel or airport Wi-Fi, the login page may be missing.
- Restart the router.
- Set the resolver by hand. Your provider's DNS or a public one? compares them.
When it works again, see which resolver you're really using: