Guides /DNS
DNS

How to Flush Your DNS Cache (Windows, Mac, and Linux)

February 14, 20266 min readHostBible Team

Your computer caches DNS results locally to avoid repeating the same lookup every time you visit a site. When DNS records change, a new server IP, updated nameservers, a fixed A record, your local cache may still serve the old answer for hours. Flushing the DNS cache forces your system to discard stored records and fetch fresh ones on the next request.

When to Flush Your DNS Cache

You should flush your DNS cache when:

  • You've updated a DNS record and want to test the change on your own machine immediately.
  • A site is loading incorrectly or showing an old version after a migration.
  • You're seeing a DNS error (NXDOMAIN, "server not found") for a domain that should exist.
  • You've changed your DNS server settings and want them to take effect immediately.
  • You're debugging a DNS problem and need to rule out local caching as the cause.

Note: flushing your local cache only removes your machine's stored records. If your ISP's resolver still has an old record cached, you'll get the old answer again from that resolver. Querying a public resolver like 8.8.8.8 directly is a useful way to test what the wider internet sees.

Windows

Open Command Prompt as Administrator. Search for "cmd" in the Start menu, right-click, and select "Run as administrator".

ipconfig /flushdns

You should see: Successfully flushed the DNS Resolver Cache.

On Windows 10 and 11 you can also flush from PowerShell (no admin required for PowerShell method):

Clear-DnsClientCache

To view what's currently in your Windows DNS cache before flushing (useful for debugging):

ipconfig /displaydns

To reset all network-related caches (including Winsock, which can sometimes interfere with DNS resolution):

netsh winsock reset
netsh int ip reset
ipconfig /flushdns
ipconfig /release
ipconfig /renew

macOS

Open Terminal (Applications > Utilities > Terminal) and run the appropriate command for your macOS version.

macOS Monterey, Ventura, Sonoma (and most versions since High Sierra):

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

You'll be prompted for your password. No output message means it worked successfully. Some older macOS versions require a slightly different command:

# macOS Sierra and earlier
sudo killall -HUP mDNSResponder

# macOS Yosemite
sudo discoveryutil mdnsflushcache

To verify mDNSResponder is the active DNS service on your Mac:

sudo lsof -i :53

Linux

Linux DNS caching depends on which service is running. Most modern distributions use systemd-resolved.

Check which DNS service is running:

systemctl status systemd-resolved

If systemd-resolved is active:

sudo systemd-resolve --flush-caches

Verify the flush worked:

sudo systemd-resolve --statistics

If you're using nscd (Name Service Cache Daemon):

sudo service nscd restart

If you're running dnsmasq:

sudo service dnsmasq restart

On some minimal Linux setups with no local DNS caching service, there's nothing to flush, DNS queries go directly to the configured resolver each time.

Flush Chrome's Internal DNS Cache

Chrome maintains its own DNS cache independently of the operating system. Even after flushing the system cache, Chrome may still serve old records until its internal cache is cleared. This is a common source of confusion, you flush the system cache, but Chrome still shows the old site.

  1. In the Chrome address bar, navigate to: chrome://net-internals/#dns
  2. Click Clear host cache.
  3. Switch to the Sockets tab and click Flush socket pools. This closes any open connections that might be reusing a cached IP.

Firefox also caches DNS. To clear it: type about:networking#dns in the address bar and click Clear DNS Cache.

After Flushing: What to Expect

Once your local cache is flushed, your next DNS query goes to your configured resolver (usually your ISP's, or a service like 8.8.8.8 or 1.1.1.1). That resolver then checks its own cache. If the change hasn't propagated to your resolver yet, you'll still see the old record, but this time it's the resolver's cache holding things up, not yours.

To test independently of your resolver's cache, query a public resolver directly:

nslookup yourdomain.com 8.8.8.8

If this returns the new IP, Google's resolver has updated. If your browser still shows the old site after flushing your system cache, try also clearing Chrome's internal DNS cache and restarting the browser.

Register your domain with HostBible

Register your domain directly with HostBible and it connects to your hosting automatically. No DNS propagation headaches, no manual configuration needed.

Register a Domain