How DNS Works and How to Fix Common DNS Problems

Follow a DNS lookup from your browser to the authoritative server, learn the record types you will actually meet, and fix slow or failing name resolution step by step.

Published by SpeedTesting.dev · Updated · 4 min read

Quick answer

When a site will not load but its IP address does, the problem is DNS. Check the record with a lookup tool, compare resolvers, clear the local cache, and remember that changes wait out the old TTL.

What DNS Does

The Domain Name System translates names people can remember, such as example.com, into the IP addresses computers use to connect. Almost every connection your device makes starts with a DNS lookup, so when DNS is slow or broken, everything feels broken, even though the underlying connection may be fine.

DNS is also more than addresses. The same system tells mail servers where to deliver email for a domain, publishes the email authentication policies covered in our SPF, DKIM, and DMARC guide, and proves domain ownership to services such as certificate authorities.

The Journey of a Single Lookup

When you type a name into a browser, the request passes through several layers, and any of them can answer from cache:

  • The browser checks its own short-lived cache.
  • The operating system checks its cache and the local hosts file.
  • The query goes to a recursive resolver, usually run by your internet provider or a public service such as Cloudflare (1.1.1.1), Google (8.8.8.8), or Quad9 (9.9.9.9). Your router often sits in between and forwards queries.
  • If the resolver does not have a cached answer, it asks a root server which servers handle the top-level domain (.com), asks those which servers are authoritative for example.com, and finally asks the authoritative server for the record.
  • The answer travels back with a TTL (time to live) value that says how many seconds it may be cached.

A cold lookup that walks the whole chain might take 50–150 ms. A cached answer from a nearby resolver takes a few milliseconds. This is why the choice of resolver can make browsing feel noticeably snappier or slower.

Record Types You Will Actually Meet

  • A: maps a name to an IPv4 address.
  • AAAA: maps a name to an IPv6 address.
  • CNAME: makes one name an alias of another, such as www pointing to a hosting provider's hostname.
  • MX: lists the mail servers that accept email for the domain, with priority numbers (lower is preferred).
  • TXT: free-form text, used for SPF policies, DMARC, domain verification codes, and more.
  • NS: names the authoritative nameservers for the domain.
  • CAA: lists which certificate authorities may issue TLS certificates for the domain.
  • PTR: reverse DNS, mapping an IP address back to a hostname.

You can query any of these with our DNS lookup tool. For mail records specifically, use the MX lookup; for reverse records, the reverse DNS lookup.

Is It Really DNS? A Quick Diagnosis

Classic DNS symptoms: the browser shows "server not found", "DNS_PROBE_FINISHED_NXDOMAIN", or "This site can't be reached", while other apps that do not need new lookups keep working. Pages may also be slow to start loading but fast once they begin.

To confirm, try these checks in order:

  • Look the name up with our DNS lookup tool. If it resolves there, the domain itself is fine and the problem is local to your device, router, or resolver.
  • From your computer, query the name against your normal resolver and against a public one (commands below). If the public resolver answers and yours does not, your ISP's or router's resolver is the problem.
  • Try to reach a known IP address directly, for example by pinging 1.1.1.1. If the IP works but names do not, the connection is up and DNS is the fault.

Our nslookup and dig guide explains these commands and their output in detail.

Command examples
Windows : Compare resolvers
nslookup example.com
nslookup example.com 1.1.1.1
        
macOS : Compare resolvers
dig example.com +short
dig @1.1.1.1 example.com +short
        
Linux : Compare resolvers
dig example.com +short
dig @1.1.1.1 example.com +short
        

Fixes That Work

Clear the local cache

A stale cached answer is a common cause after a site moves to a new server. Clear the operating system cache, then restart the browser (browsers keep their own cache).

Change your resolver

If your provider's resolver is slow or unreliable, set a public resolver on the router (affects every device) or on a single device. Cloudflare, Google, and Quad9 all operate fast anycast resolvers; Quad9 also blocks domains known to host malware.

Restart the router

Many home routers run a small DNS forwarder that occasionally stops responding. A restart clears it; if the problem returns, set devices to use a public resolver directly.

Check security software and VPNs

VPN apps and some security suites intercept DNS. If problems appear only with one of them active, adjust its DNS settings or contact its support.

Command examples
Windows : Flush the DNS cache
ipconfig /flushdns
        
macOS : Flush the DNS cache
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
        
Linux : Flush the cache (systemd-resolved)
resolvectl flush-caches
resolvectl statistics
        

Why DNS Changes Take Time to "Propagate"

When you change a DNS record, the authoritative server updates almost immediately. What takes time is waiting for resolvers around the world to discard their cached copy of the old answer, which they may keep for as long as the old record's TTL. If the old TTL was 86,400 seconds, some users may see the previous value for up to a day.

The practical approach for a planned change is to lower the TTL to something like 300 seconds a day or two before the change, make the change, confirm it, then raise the TTL again. Our DNS propagation checker queries several public resolvers so you can see which ones have picked up the new value.

DNS Privacy and Security in Brief

Traditional DNS queries are sent unencrypted, so anyone on the path can see which names you look up. DNS over HTTPS (DoH) and DNS over TLS (DoT) encrypt the queries between your device and the resolver; most modern browsers and operating systems support at least one of them.

DNSSEC solves a different problem: it lets resolvers verify that an answer really came from the domain's owner and was not altered. Domain owners can check their configuration with our DNSSEC checker. If you use a VPN, also run the DNS leak test to confirm your queries go where you expect.

Related Articles

Useful tools