Next-Gen App & Browser Testing Cloud

Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Next-Gen App & Browser Testing Cloud

How to Flush DNS (Clear the DNS Cache)

Updated November 30, 2026 · Written and reviewed under our editorial policy

Flushing DNS deletes the saved list of website addresses your computer uses, so the next visit looks each site up again. On Windows, run ipconfig /flushdns in Command Prompt. On a Mac, run sudo killall -HUP mDNSResponder in Terminal. Chrome keeps its own cache, which you clear at chrome://net-internals/#dns.

Windows 10 and 11:

  • Click Start, type cmd, right-click Command Prompt and choose Run as administrator.
  • Type ipconfig /flushdns and press Enter.
  • Look for "Successfully flushed the DNS Resolver Cache."

Mac:

  • Open Terminal.
  • Run sudo killall -HUP mDNSResponder and enter your Mac password. No output means it worked.

Chrome: open chrome://net-internals/#dns and click Clear host cache.

Source: Microsoft Learn, "ipconfig", and Apple Support, "Reset the DNS cache in OS X", checked 2026-11-28.

What flushing DNS does (and when it helps)

Flushing DNS empties the DNS cache, the list of recent name-to-address lookups your system keeps so it doesn't have to ask a DNS server every time. Each entry stays cached until its TTL (time to live) runs out, so after a change you can keep reaching an old address for a while. Flushing helps in three cases:

  • A DNS record changed: you updated a domain's records and your machine still uses the old ones.
  • A site moved hosts: the site now lives on a new server, but you keep landing on the old one.
  • Lookup errors: a site that should work shows DNS_PROBE_FINISHED_NXDOMAIN or a similar "can't be reached" error, and a stale or failed lookup is cached.

Flushing DNS is not a speed hack. Your computer has to look every site up again afterwards, so browsing is not faster. After a change on your own domain, check whether new DNS records have spread to DNS servers around the world before you flush anything.

Moved a site to a new host? Flush DNS on your machine, then check the live site from other locations on 3,000+ browsers with TestMu AI.

Flush DNS on Windows 11 and 10

To flush DNS on Windows 11 and 10, use the ipconfig command. Microsoft describes /flushdns as the switch that "flushes and resets the contents of the DNS client resolver cache." Running Command Prompt as administrator is the safe default.

  • Click Start, type cmd, right-click Command Prompt and choose Run as administrator.
  • Type ipconfig /displaydns and press Enter to see what is cached now (optional).
  • Type ipconfig /flushdns and press Enter.
  • Check for the message Successfully flushed the DNS Resolver Cache.
  • Run ipconfig /displaydns again: the list is now short or empty.

In PowerShell, the command Clear-DnsClientCache does the same job.

Flush DNS on Mac

To flush DNS on a Mac, run one command in Terminal:

  • Open Terminal (Applications > Utilities, or search for it with Spotlight).
  • Type sudo killall -HUP mDNSResponder and press Return.
  • Enter your Mac password when asked. Terminal doesn't show the characters as you type them.

The command prints nothing when it works, so no output is normal. Apple's support article (now archived) gives this command for OS X 10.10.4 and later.

Flush DNS on Linux

Flushing DNS on Linux depends on which service caches lookups on your system, and some installs don't cache DNS at all. Most current Ubuntu and Fedora installs use systemd-resolved. Check which one you run first:

  • systemd-resolved: systemctl is-active systemd-resolved prints active. Flush it with sudo resolvectl flush-caches. On older releases the command is sudo systemd-resolve --flush-caches.
  • nscd: systemctl is-active nscd prints active. Flush the host cache with sudo nscd -i hosts, or restart it with sudo systemctl restart nscd.
  • dnsmasq: systemctl is-active dnsmasq prints active. Restart it with sudo systemctl restart dnsmasq.

If none of these is active, your system isn't caching DNS and there is nothing to flush. Other caches on the machine are a separate job; see how to clear cache in Linux.

Clear Chrome's DNS cache

Chrome's DNS cache is separate from the one in your operating system, so clear it too when a site still resolves to the old address.

  • Type chrome://net-internals/#dns in the address bar and press Enter.
  • Click Clear host cache.
  • Open the Sockets page in the left menu and click Flush socket pools, so Chrome drops connections it already opened to the old server.

The host cache holds addresses only. If the page itself still looks old, clear the browser cache in Chrome as well. Brave is built on Chromium and works the same way; here's how to clear the Brave DNS cache.

Chrome net-internals DNS page with the Clear host cache button

Flush DNS on iPhone and Android

iPhone and Android don't offer a command to flush DNS. To clear the phone's cached lookups, restart it: switch the phone off and on again.

If one Android app keeps showing stale content, clear that app's cache too.

Still seeing the old site?

If you still see the old site after you flush DNS, the old answer is cached somewhere other than your computer:

  • Your router: many home routers cache DNS. Restart the router to clear it.
  • Your ISP's resolver: your internet provider's DNS server keeps the old record until its TTL expires. You can only wait, or switch your device to another DNS server.
  • The hosts file: a line for the domain in C:\Windows\System32\drivers\etc\hosts (Windows) or /etc/hosts (Mac and Linux) overrides DNS. Remove it and save the file.
  • The browser cache: the browser can show a saved copy of the old page. Clear the cache or try a private window.

To see whether the new record has reached resolvers in other regions, run the domain through our free DNS propagation checker. If lookups fail on a work network, a proxy or firewall may be involved; here's how to check proxy, firewall and DNS settings.

Frequently Asked Questions

Is it safe to flush DNS?

Yes. Flushing DNS only clears cached address lookups. Your computer looks each site up again the next time you visit it, so the first visit to each site can take a moment longer.

How often should I flush DNS?

Only when you need to: when a site won't load, or when a site has just moved to a new server and you still see the old one. There is no benefit to flushing DNS on a schedule.

Does flushing DNS clear browser history?

No. Flushing DNS removes saved address lookups only. Your browsing history, cookies, saved passwords and browser cache stay as they are.

How do I check if DNS was flushed on Windows?

Run ipconfig /displaydns in Command Prompt. Straight after a flush it shows a short or empty list, which then fills up again as you browse.

Why didn't flushing DNS fix my problem?

Your router or your internet provider's DNS server may still hold the old record until its TTL (time to live) expires. A line in your hosts file or the browser's own cache can also keep sending you to the old address.

Related Questions

Test Your Website on 3000+ Browsers

Get 100 minutes of automation test minutes FREE!!

Test Now...

KaneAI - Testing Assistant

World’s first AI-Native E2E testing agent.

...

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests