HTTP vs DNS

HTTP 404 Not Found vs DNS NXDOMAIN (RCODE 3)

HTTP 404 and DNS NXDOMAIN both mean 'not found' but at completely different layers of the network stack. NXDOMAIN means the domain name itself does not exist in DNS, while HTTP 404 means the domain exists and the server is reachable, but the specific URL path has no resource.

Description

The server cannot find the requested resource. The URL may be wrong, the resource may have been deleted, or it may never have existed.

When You See It

When a URL is mistyped, a page has been deleted, or an API endpoint doesn't exist.

How to Fix

Verify the URL is correct. Check for typos, case sensitivity, and trailing slashes.

Description

Non-Existent Domain. The queried domain name does not exist in the DNS namespace.

When You See It

The domain has no DNS records at all — either it was never registered, has expired, or you have a typo in the hostname.

How to Fix

Double-check the domain spelling. If you own the domain, verify your registrar settings and ensure the nameservers are correctly delegated.

Key Differences

1.

NXDOMAIN occurs at the DNS layer before any HTTP connection is established — the domain itself does not resolve.

2.

HTTP 404 occurs after DNS resolution succeeds and a TCP/TLS connection is established with the web server.

3.

NXDOMAIN affects the entire domain (all URLs); HTTP 404 affects only one specific URL path.

4.

NXDOMAIN can be cached by DNS resolvers per the SOA TTL; HTTP 404 caching depends on Cache-Control headers.

5.

Users see NXDOMAIN as 'DNS_PROBE_FINISHED_NXDOMAIN' in browsers; HTTP 404 shows the server's custom error page.

When to Use Which

You cannot 'return' NXDOMAIN — it is generated by DNS resolvers when a queried domain has no records. You return HTTP 404 from your web server when a requested URL path does not match any route. If a user reports 'site not found', check DNS first (NXDOMAIN), then the web server (404).

Learn More