Skip to content
On this page

Fix DNS Cache Issues

After DNS changes (new subdomain, domain transfer, A record update, etc.) you may not be able to reach your site locally — even though DNS is already active globally.

On Chrome you may get DNS_PROBE_FINISHED_NXDOMAIN, Firefox just shows error. Your local DNS resolver caches outdated entries. Ubuntu uses systemd-resolved via 127.0.0.53, which sometimes caches too aggressively.

Quick test

Use an external DNS resolver directly:

bash
dig example.com @8.8.8.8

→ If that returns the correct IP but dig example.com without @8.8.8.8 returns NXDOMAIN or an old IP, your local DNS is outdated.

Persistent fix

Tell Ubuntu to use public DNS resolvers.

Edit:

bash
sudo nano /etc/systemd/resolved.conf

Set in the [Resolve] block:

ini
DNS=8.8.8.8
FallbackDNS=1.1.1.1
  • 8.8.8.8 = Google DNS (fast and reliable)
  • 1.1.1.1 = Cloudflare DNS (privacy-focused fallback)

Restart the resolver:

bash
sudo systemctl restart systemd-resolved

Now dig example.com should return the correct IP.

Other solutions

If the DNS change already propagated globally (check via online tools) but still doesn't work locally, try these steps:

1. Flush local DNS cache

Your OS caches DNS entries.

Windows (run CMD as Administrator):

bash
ipconfig /flushdns

macOS:

bash
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Linux (systemd-resolved):

bash
resolvectl flush-caches

2. Clear browser DNS cache

Browsers have their own DNS cache.

  • Chrome: Go to chrome://net-internals/#dns → Click "Clear host cache"
  • Firefox: Go to about:config → Set network.dnsCacheExpiration to 0 temporarily

3. Switch DNS server

Your ISP's DNS servers may update slower. Try public DNS:

  • Google DNS: 8.8.8.8
  • Cloudflare DNS: 1.1.1.1

4. Hard refresh

Force reload without cached assets:

Press Ctrl + F5 (or Ctrl + Shift + R) on the website.