DNS issues vs server issues: a beginner's guide
When a page will not load, the browser usually gives you a hint. The trick is knowing whether the hint points at a DNS problem or a server problem. The two have different fixes.
DNS in one paragraph
DNS, short for Domain Name System, is the phonebook of the internet. When you type example.com, your computer asks a DNS server, which translates that name into a number called an IP address. The browser then connects to that number to load the site.
What a DNS problem looks like
If DNS fails, your computer never finds out where the site lives. The browser gives up before even trying to talk to the server. Common messages include:
- This site can't be reached. server's IP address could not be found.
- DNS_PROBE_FINISHED_NXDOMAIN (Chrome).
- Server not found (Firefox).
- Safari can't find the server.
All of these say roughly the same thing: the name did not resolve.
What a server problem looks like
If DNS works but the server itself is the problem, the browser connects, gets a reply, and the reply is an error. Common messages include:
- 500 Internal Server Error. Something blew up on the server.
- 502 Bad Gateway. A proxy in front of the server can not reach the real server.
- 503 Service Unavailable. The server is up but overloaded or being restarted.
- 504 Gateway Timeout. A proxy waited too long for the server to reply.
All of these mean the request reached a server, but the server could not finish the job.
A quick test to tell them apart
Open a terminal and try one or both of these:
- Type nslookup example.com or dig example.com. If it returns an IP address, DNS is working. If it errors out, DNS is broken.
- Type curl -I https://example.com. If it returns HTTP headers, even error codes, the server is responding. If it says could not resolve host, DNS is the problem.
An external checker like QuickUptime can do this for you from a different network, which removes your own DNS and ISP from the equation.
How to fix a DNS problem on your end
If the problem is local DNS, here is what to try:
- Flush your DNS cache. The commands are above in our other guide.
- Switch to a public DNS service like Cloudflare (1.1.1.1) or Google (8.8.8.8). You change these in your router or in your device's network settings.
- Restart your router. It also caches DNS and can carry stale records.
- Try the page on a different network, like mobile data, to confirm the issue is local.
How to fix a DNS problem on a site you own
If you own the site and DNS is broken for visitors:
- Log in to your domain registrar or DNS provider and check that the records still exist.
- Confirm that the A record or AAAA record points to the correct IP address.
- Check that the domain has not expired. An expired domain stops resolving.
- Lower your TTL for the next change so propagation is faster.
- Use a DNS lookup tool to confirm the records are visible from multiple regions.
How to react to a server error
If you are a visitor and see a 5xx error, there is not much you can do except wait and retry. Most server errors clear within minutes.
If you own the site, the error code itself is the clue:
- 500: check application logs for the exception that crashed the page.
- 502: the front proxy can not reach your app. Make sure the app process is running and listening on the right port.
- 503: the server is overloaded or restarting. Add capacity or finish the restart.
- 504: a backend service is too slow. Find the slow query, slow API call, or slow upstream.
Why DNS issues feel more frustrating
Server errors usually fix themselves quickly. DNS issues can linger because of caching. Even after a DNS record is fixed, caches around the internet may still serve the old value for minutes or hours. That is normal, and lowering your TTL before making changes is the way to reduce it next time.
If you remember one thing from this guide, remember this: a DNS error means the browser never reached the server. A server error means the browser reached the server but the server could not deliver the page.