How do you clear DNS cache?

Quick Answer

Clear DNS cache when a device keeps using stale or incorrect DNS results; flushing the cache forces the next lookup to request fresh records.

Clearing DNS cache is one of the safest ways to test whether a name-resolution issue is caused by stale local data rather than an active outage.

Step-by-step solutions

  1. Flush the operating system DNS cache.
  2. Restart the browser or app that is showing the problem.
  3. Retry the failing domain.
  4. If the issue continues, switch resolvers or reset DNS settings.

Useful commands

Windows

ipconfig /flushdns

macOS

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

Linux

sudo systemd-resolve --flush-caches
resolvectl statistics

If flushing cache fixes the problem only briefly, a failing resolver may still be upstream. Continue with how to fix DNS server problems or what DNS failure means.

FAQ

What happens when I clear DNS cache?

The device removes stored name-resolution entries, so the next request has to fetch fresh DNS information.

Is clearing DNS cache safe?

Yes. It is a standard troubleshooting step and only causes temporary re-resolution of domains.

Why does stale DNS cache cause problems?

Old entries can keep pointing to the wrong address after a service moves, changes CDN routing, or updates records.

Do browsers have their own DNS cache?

Yes. Some browsers and apps keep separate caches, so clearing only the operating system cache may not be enough.

Test your DNS now

Download DNS Benchmark for free and find the fastest server for your network.