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

Short answer: To flush your DNS cache, run ipconfig /flushdns in Windows Command Prompt or PowerShell, sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder in macOS Terminal, or sudo resolvectl flush-caches on Linux systems using systemd-resolved. To clear the browser's own copy, open chrome://net-internals/#dns and click Clear host cache. Flushing only removes locally stored name-to-IP answers. It does not clear history, cookies, or passwords.

Flushing DNS is the fastest fix when a website won't load after its address changed, or when you see errors like DNS_PROBE_FINISHED_NXDOMAIN or This site can't be reached for a site you know is up. Your computer keeps a local copy of each name-to-IP answer it has looked up so it doesn't have to ask a resolver again. That copy can go stale. Clearing it forces the next lookup to go out fresh.

Before you start

Quick reference

PlatformCommand or actionWhere to run it
Windows 10 and 11ipconfig /flushdnsCommand Prompt or PowerShell
macOS (current versions)sudo dscacheutil -flushcache then sudo killall -HUP mDNSResponderTerminal
Linux, systemd-resolvedsudo resolvectl flush-cachesTerminal
Linux, nscdsudo nscd -i hosts (or sudo systemctl restart nscd)Terminal
ChromeClear host cachechrome://net-internals/#dns
EdgeClear host cacheedge://net-internals/#dns
FirefoxClear DNS Cacheabout:networking#dns

How to flush DNS on Windows

  1. Open Start, type cmd or PowerShell, and open it.
  2. Run:
    ipconfig /flushdns
  3. A successful flush prints: Successfully flushed the DNS Resolver Cache.

To confirm the cache is empty, run ipconfig /displaydns. It should list few or no entries.

How to flush DNS on Mac

Modern macOS keeps its resolver cache in a service called mDNSResponder. A full flush takes two commands, and you need your administrator password.

  1. Open Terminal (Applications → Utilities → Terminal).
  2. Run:
    sudo dscacheutil -flushcache
    sudo killall -HUP mDNSResponder
  3. Enter your password when prompted. A successful run prints nothing. If you see No matching processes were found, the killall step found no running mDNSResponder process under that name; the first command still ran.

Some older guides list only the first command. On current macOS, run both for a full flush.

How to flush DNS on Linux

The command depends on which resolver your distribution uses.

systemd-resolved (Ubuntu, Fedora, and most recent desktop distributions):

sudo resolvectl flush-caches

Systems on systemd 239 or earlier use sudo systemd-resolve --flush-caches.

nscd (Name Service Cache Daemon):

sudo nscd -i hosts

If that isn't available, restart the service: sudo systemctl restart nscd.

dnsmasq: restart it to clear its cache: sudo systemctl restart dnsmasq.

Not sure which one you have? Run resolvectl status. If it prints output, you're on systemd-resolved. If the command isn't found, check systemctl status nscd and systemctl status dnsmasq.

How to clear the DNS cache in your browser

Browsers keep their own DNS cache, separate from the operating system's. If the OS flush doesn't help, clear the browser too.

These pages are for troubleshooting. Don't change other settings on them unless you know what they do.

How to flush DNS on iPhone and Android

Neither iOS nor Android offers a direct DNS cache flush. Two practical options:

When flushing won't fix it

A flush removes only the copy stored on your device. A stale answer can also live in:

TTL matters. A record's time-to-live (TTL) sets how long resolvers may cache it. If the old record had a TTL of 86,400 seconds (24 hours), some resolvers may keep the old answer for up to a day, no matter what you flush locally. Lowering the TTL before a planned change shortens that window.

How to check the flush worked

On macOS and Linux, dig example.com gives the same answer, plus the TTL. Compare the answer with what your browser loads.

If the public answer is correct and your browser still fails, clear the browser cache as described above.

Does flushing DNS speed up my internet?

Not in general. A DNS flush forces a new lookup, which takes a moment. It only helps when a stale or wrong answer is the cause. If pages are slow across the board, look at your connection, Wi-Fi signal, or a resolver that's slow to respond.

Frequently asked questions

Is it safe to flush DNS?

Yes. It removes only locally stored name-to-IP answers. It doesn't delete browsing history, saved passwords, or cookies, and it doesn't change your settings.

How often should I flush DNS?

Only when you need to: after a site moves to a new server, after you change DNS records, or when a name stops resolving. There's no need to flush on a schedule.

Why does ipconfig /flushdns say it succeeded but the site still fails?

The stale answer is probably cached somewhere else: in your browser, your router, or your ISP's resolver. It can also be a real propagation delay. Work through the browser step and the router step above.

Do I need to restart my computer after flushing?

No. A flush takes effect immediately. A restart also clears the cache, but it's slower.

Does flushing DNS fix a DNS leak?

No. A flush clears old answers. It doesn't change which resolver your device uses. To check which resolver your lookups reach, run the DNS leak test.

Can flushing DNS fix "DNS_PROBE_FINISHED_NXDOMAIN"?

Sometimes. That error means Chrome couldn't resolve the name. If the site works on your phone, flush your computer's DNS and Chrome's host cache. If it still fails, the name may not exist yet or may point to a server that's down.