You changed a DNS record, other people can see the new site, and you still can't. Or a page that was working yesterday now throws a "server not found" error and nobody else has a problem. Both situations have the same cheap first fix: clear the DNS cache on your own machine.

The cache is a small notebook your computer keeps of recent lookups so it doesn't have to ask the network every time. Usually that's a good thing. After a DNS change it's the reason you're staring at yesterday's answer. Flushing wipes the notebook and forces fresh lookups.

What flushing does and doesn't do

Be clear about the limits before you start. Flushing clears your device's memory only. It won't touch the caches at your ISP or on a public resolver, so if the rest of the world still sees the old record, the wait is out of your hands. Our article on DNS propagation explains why. Flushing also doesn't fix a wrong record: if the record itself is bad, a flush will just fetch the wrong answer again, quickly.

Windows 10 and 11

Open Command Prompt or PowerShell. Administrator rights aren't required for this one:

ipconfig /flushdns

You should see "Successfully flushed the DNS Resolver Cache." If you're curious what was in there beforehand, ipconfig /displaydns prints the contents. If you have trouble beyond the cache itself, these two commands reset the network stack, and need a restart afterwards:

netsh winsock reset
netsh int ip reset

Run them from an elevated window, and only as a last resort, since they also undo custom network settings.

macOS

The command has changed names a few times over the years, but this one works on every recent version:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

You'll be asked for your password. There's no confirmation message, which is normal. macOS doesn't offer a command to list the cache, so you can't see what was stored; the quickest check is to look up the domain again.

Linux

It depends on what your system uses to resolve names, which is the annoying part. Try these in order:

# systemd-resolved (Ubuntu, Fedora, Debian and most others)
sudo resolvectl flush-caches

# older systemd releases
sudo systemd-resolve --flush-caches

# nscd
sudo nscd -i hosts

# dnsmasq
sudo systemctl restart dnsmasq

# unbound
sudo unbound-control flush_zone example.com

On a fresh install of a recent distribution the first command is almost always the one you need. To check whether it worked, run resolvectl statistics and look at the cache figures.

Chrome, Edge and other Chromium browsers

Browsers keep a second, separate cache. Even after you flush the operating system, Chrome can keep using its own copy for a minute or so. Type this into the address bar:

chrome://net-internals/#dns

Click Clear host cache. For Edge, replace the scheme with edge://. It's also worth closing the open tabs of the affected site afterwards, because pages that are already open can hold on to existing connections.

Firefox

Firefox hides the option well. The simplest way is to open Settings, Privacy and Security, click Clear Data under Cookies and Site Data, and clear the cache. Restarting Firefox also wipes the DNS cache. If you want to look at what's stored first, about:networking#dns lists the entries and their expiry times.

Android and iPhone

Mobile systems don't give you a flush command. The practical options are the same on both:

  • Switch airplane mode on, wait ten seconds and switch it off.
  • Toggle Wi-Fi off and on, or forget and rejoin the network.
  • Restart the phone if the problem persists.
  • On Android Chrome, the chrome://net-internals/#dns page works as on a desktop.

The router might be hiding a stale answer too

Many home routers run a little DNS forwarder with its own cache. If flushing the computer changes nothing, unplug the router for thirty seconds and plug it back in. It's the digital equivalent of "have you tried turning it off and on", and it's right more often than it deserves to be.

When the flush didn't help

If you've flushed everything and still get the wrong result, work down this list.

  1. Check the hosts file. An old line in C:\Windows\System32\drivers\etc\hosts (Windows) or /etc/hosts (macOS and Linux) overrides DNS entirely and survives any flush.
  2. Ask a different resolver. Run nslookup example.com 8.8.8.8. If that returns the new answer, your normal resolver is the one holding the old data, and no local flush can reach it.
  3. Look at VPNs and proxies. They often bring their own DNS settings and caches.
  4. Compare resolvers worldwide. Use the DNS propagation checker to see which locations already have the new value. If many do, the problem is local.

Do you need to flush regularly?

No. Flushing isn't maintenance, and doing it daily doesn't make a computer faster; it just throws away answers that would have been served instantly. Treat it as a troubleshooting step for specific moments: right after a DNS change, after switching DNS servers, when a VPN misbehaves, or when one site fails while everything else works. The rest of the time the cache is quietly saving you a few milliseconds on thousands of lookups a day.

Cache length depends on the TTL

One last thing worth knowing: even without flushing, entries expire on their own once the record's TTL runs out. A short TTL means you'd barely notice stale data; a long one is why a flush feels so helpful. If you're planning a change and want to avoid the whole issue, read DNS TTL explained and lower the value ahead of time. And if you're still seeing browser error pages, our guide to fixing DNS errors goes through the next steps.