How to Flush DNS Cache on Windows, Mac, Linux, and Chrome

Last Updated on: July 15, 2026

To flush DNS cache entries, you run one short command for your operating system. You can also clear the host cache in your browser. It takes a few seconds and fixes many common name-resolution problems. This guide gives you the exact steps for Windows, macOS, Linux, and Chrome.

A stale DNS cache often causes sites that will not load, resolve to the wrong server, or throw connection errors. Clearing it forces your device to look up fresh records. Below is the quick command for each platform, followed by the full walkthrough and verification.

TL;DR — flush DNS cache commands
  • Windows: open Command Prompt as administrator and run ipconfig /flushdns.
  • macOS: in Terminal, run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder.
  • Linux (systemd): run sudo resolvectl flush-caches.
  • Chrome / Edge: open chrome://net-internals/#dns and click Clear host cache.
  • Confirm the fix with a fresh DNS lookup to check you now get the right IP address.

What is a DNS cache, and why flush it?

A DNS cache is a temporary table of recent domain-to-IP lookups your device stores to speed up browsing. Flushing it deletes those saved records. Your system then fetches fresh answers on the next lookup instead of reusing stale ones.

Caching exists because DNS lookups add delay to every connection. Once your device learns that example.com maps to an IP, it reuses that answer for a while. Asking again would only add delay. For background on the lookup itself, see our guide on how DNS works.

The problem is that cached records can outlive their usefulness. When a site moves to a new server, the old cached answer keeps pointing at the wrong place. The same happens when you change your DNS settings. Flushing clears that stale entry so the correct record can take its place.

When to flush your DNS cache

Flush your DNS cache when a site refuses to load, resolves to the wrong address, or throws errors like DNS_PROBE_FINISHED_NXDOMAIN. It also helps after you edit your hosts file, switch DNS servers, or move a site to a new host.

Common situations where a flush is the right first step include:

  • A website you manage moved hosts, but your browser still loads the old server.
  • You changed your resolver to Cloudflare or Google and want it to take effect now.
  • You edited the hosts file and the change is not being applied.
  • You see a browser error such as DNS_PROBE_FINISHED_NXDOMAIN, covered in our fix for DNS probe finished, no internet.

Flushing is safe and quick, so it is a reasonable thing to try early. If it does not help, the cause is usually a cache you cannot reach, which we cover further down.

How to flush DNS cache on Windows

To flush the DNS cache on Windows, open Command Prompt or PowerShell as administrator and run ipconfig /flushdns. Windows confirms with a success message. The same command works on Windows 10, Windows 11, and Windows Server.

# Command Prompt or PowerShell (Run as administrator)
ipconfig /flushdns

# Expected output:
# Successfully flushed the DNS Resolver Cache.

PowerShell also has a native equivalent, Clear-DnsClientCache, which does the same job. To see what is currently cached before you clear it, run ipconfig /displaydns.

If a flush alone does not fix a stubborn connection, a deeper network reset may be needed. Our guide to Windows network reset commands covers ipconfig /release, ipconfig /renew, and the Winsock reset.

How to flush DNS cache on macOS

To flush the DNS cache on macOS, open Terminal and run two commands together. The first clears the stored records, and the second restarts the service that answers lookups. macOS prints no confirmation, so a clean return to the prompt means success.

# Terminal (modern macOS: Ventura, Sonoma, Sequoia)
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

You will be asked for your administrator password, and nothing appears as you type it. Both commands matter: dscacheutil empties the cache, while killall -HUP mDNSResponder restarts the responder that handles DNS and Bonjour.

Older releases used a single command. On macOS Mojave and earlier, sudo killall -HUP mDNSResponder on its own was enough. If you are unsure of your version, running both commands does no harm.

How to flush DNS cache on Linux

To flush the DNS cache on Linux, the command depends on your resolver. Most modern systems run systemd-resolved, where sudo resolvectl flush-caches clears the cache. Systems using nscd or dnsmasq flush by restarting that service instead.

First confirm which resolver your system uses, then run the matching command:

# systemd-resolved (Ubuntu 18.04+, Debian 10+, Fedora)
sudo resolvectl flush-caches
# older syntax: sudo systemd-resolve --flush-caches

# nscd (older or LDAP-based systems)
sudo systemctl restart nscd

# dnsmasq
sudo systemctl restart dnsmasq

# BIND local resolver
sudo rndc flush

To confirm the flush worked, run resolvectl statistics. Check that the current cache size reads zero. Note that nscd is now legacy. Fedora removed it in Fedora 36, and modern Fedora and RHEL rely on systemd-resolved plus sssd instead. Many Linux desktops do not cache DNS at all unless one of these services is installed.

How to flush DNS cache in Chrome and other browsers

To flush the DNS cache in Chrome, open chrome://net-internals/#dns and click Clear host cache. Browsers keep their own DNS cache on top of the operating system. This step matters when a system flush alone does not clear a stale lookup.

The internal DNS pages differ slightly by browser:

  • Chrome and Brave: visit chrome://net-internals/#dns, then Clear host cache. Also flush open connections at chrome://net-internals/#sockets.
  • Microsoft Edge: use edge://net-internals/#dns, which works the same way.
  • Firefox: open about:networking#dns and click Clear DNS Cache. On builds without that button, set network.dnsCacheExpiration to 0 in about:config.
  • Safari: it uses the macOS system resolver, so the macOS commands above already cover it. To clear Safari’s own site caches, enable the Develop menu and choose Empty Caches.

One caveat applies. If the browser has DNS over HTTPS enabled, it may use its own encrypted resolver. That bypasses the system cache entirely. In that case, clear the browser cache rather than the operating system one.

How to flush DNS on iPhone and Android

Neither iOS nor Android exposes a direct flush command. The quickest way to clear a phone’s DNS cache is to toggle Airplane Mode off and on. Restarting the device also works. A full network-settings reset works too, but it also clears saved Wi-Fi passwords.

For most phone issues, toggling Airplane Mode for a few seconds drops cached entries and forces fresh lookups. Restarting the device has the same effect. If toggling Airplane Mode does not help, forget the Wi-Fi network and rejoin it. That forces the phone to pull fresh DHCP and DNS settings from the router. Reserve a full network-settings reset for cases where nothing else works, since you will need to rejoin every Wi-Fi network afterward.

What to do if flushing does not fix it

If flushing does not help, the stale answer is usually cached somewhere you did not clear. Your router, your ISP resolver, or a browser with its own cache may still hold it. A recent DNS change also needs time to propagate before every resolver updates.

Work through the caches you can still reach and rule out propagation:

  • Reboot your router. Home routers cache DNS too. A restart clears that layer, which a device flush cannot touch.
  • Wait for propagation. A new DNS record usually reaches resolvers within minutes to a few hours. A stubborn resolver can still take up to 48 hours, as covered in how long DNS propagation takes. Track its progress with our DNS propagation checker.
  • Check the server, not the cache. If lookups fail everywhere, the issue may be upstream. See our checklist for DNS server not responding.
  • Confirm the record itself. Run a DNS lookup from outside your network to verify the record now points where it should.
  • Test in a private window. Open the site in an Incognito or Private window. If it loads there but not in your normal window, the browser cache is the culprit, not the OS DNS cache.
  • Try a different resolver. Temporarily switch your DNS to 1.1.1.1 or 8.8.8.8. If the site then loads, your old resolver was serving a stale answer.

If a lookup from outside your network returns the correct answer but your device does not, the problem is local. If the record is still wrong everywhere, the fix is at the DNS host, not on your machine.

Frequently asked questions

Is it safe to flush your DNS cache?

Yes. Flushing the DNS cache is safe and reversible. It only deletes stored hostname-to-IP records, so your device asks its DNS server again the next time you visit a site. Nothing else on your system changes. The only trade-off is that the very next lookup for each site is slightly slower, because there is no cached answer yet.

Does flushing DNS speed up my internet?

Not really. Flushing DNS removes stale records, which can fix pages that will not load, but it does not increase your connection speed. In fact, the first lookup after a flush is a little slower, since the cache has to be rebuilt. If your internet feels slow overall, the resolver you use matters more than the cache.

How do I know the DNS flush worked?

On Windows, ipconfig /flushdns prints Successfully flushed the DNS Resolver Cache. On macOS and Linux, the commands print nothing, so returning to the prompt with no error means it worked. To confirm you now get the right answer, run a fresh lookup with nslookup or dig, or use an online DNS lookup tool, and check the IP matches what you expect.

Why does a site still load the old version after I flush DNS?

Your local DNS cache is only one of several caches. Your browser keeps its own DNS cache, your router caches answers, and your ISP resolver caches them too. On top of that, a recent DNS record change still has to propagate, which usually takes minutes to a few hours but can occasionally run longer. Flushing your device only clears the copy on that one machine.

How do I flush the DNS cache in Chrome?

Chrome keeps its own DNS cache separate from the operating system. Open a new tab, type chrome://net-internals/#dns into the address bar, and click Clear host cache. It also helps to flush the socket pools at chrome://net-internals/#sockets. Microsoft Edge uses the same tool at edge://net-internals/#dns. This is worth doing whenever a system flush alone does not help.

Do I need to flush DNS after changing my DNS server?

Usually yes. When you switch to a new DNS server, your device may keep serving answers from the old resolver until they expire. Flushing the cache forces it to query the new server right away. The same applies after you edit your hosts file or change a DNS record, so the flush is a good habit whenever DNS settings change.

Related tools

References

  1. RFC 1035 — Domain Names: Implementation and Specification (caching and TTL). rfc-editor.org/rfc/rfc1035
  2. RFC 2308 — Negative Caching of DNS Queries. rfc-editor.org/rfc/rfc2308
  3. Microsoft Learn — ipconfig command reference. learn.microsoft.com
  4. freedesktop.org — resolvectl and systemd-resolved. freedesktop.org
Secret Link