Migrate to RunxBuild and earn up to $50 in hosting credit on your first deposit.

Calculate your savings
unxBuild
Back to Blog Explainer

What Does Flushing DNS Do? Clearing the Local Cache of Stale Answers

Sean

Platform Writer

Jul 18, 2026
6 min read

Flushing DNS clears the cache of domain-to-IP answers your device keeps locally, so the next time you visit a site your computer asks a DNS server fresh instead of reusing a saved answer. That is the whole of it. It helps when a site has moved to a new server and your machine is still holding the old address, or when a cached answer is corrupt. It does not speed up your internet, fix your connection, or clear your browsing history - it only throws away stored name lookups.

What Does Flushing DNS Do? Clearing the Local Cache of Stale Answers

The reason flush your DNS is such common troubleshooting advice is that a stale cache produces a very specific, very confusing symptom: one site is broken for you while working for everyone else. Understanding what the cache is makes that symptom obvious.

Table of contents

Why your device caches DNS at all

Every time you visit a site, your device has to translate the name into an IP address by asking a DNS server. That round trip takes time - tens of milliseconds - and a single page load may need lookups for a dozen domains.

So your operating system keeps a local DNS cache: once it learns that a name maps to an address, it remembers that answer for a while and skips the lookup next time. This makes browsing noticeably faster and reduces load on DNS servers. Each cached answer has a time-to-live (TTL) set by the domain owner, after which the entry expires and is looked up again.

The cache is a performance optimization, and almost all the time it is invisible and helpful. Flushing is about the small fraction of the time when a cached answer has gone wrong.

What flushing actually removes

Flushing deletes every entry in that local cache. The next lookup for any domain has to go out to a DNS server and fetch a current answer:

Windows:  ipconfig /flushdns
macOS:    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Linux:    sudo resolvectl flush-caches

That is all it does - empty the local store of name-to-address answers. It does not touch your browser history, your cookies, your saved passwords, or your files. It does not change which DNS server you use. It does not reset your network connection.

After a flush, the first few page loads are a hair slower because the cache is cold and every name has to be looked up again. Within seconds the cache refills with fresh answers and you are back to normal - now working from current data instead of whatever was stale.

The problem it actually fixes

The classic case: a website moves to a new server, so its DNS record changes to point at a new IP. Your device, however, cached the old IP and is still using it - so you keep hitting the old, possibly dead, address while everyone whose cache has expired sees the new one.

This produces the maddening symptom of it works for everyone but me. The site is fine; your cache is stale. Flushing forces a fresh lookup, you get the new IP, and it works.

It is also the standard step after you change your own DNS records - repointing a domain to a new host. You update the record, but your own machine may still serve you the old answer from cache until the TTL expires. A flush lets you see your change immediately instead of waiting.

What flushing does not do

It is worth being clear about the limits, because flush your DNS gets recommended as a cure-all it is not:

  • It does not speed up your internet. The cache already made things faster; flushing briefly makes the next few lookups slower, not faster.
  • It does not fix a down connection. If you cannot reach the network at all, DNS is not your problem and flushing changes nothing.
  • It does not change your DNS server. You are still using the same resolver; you have just cleared what it told you before.
  • It does not clear browser history or cookies. Those are separate stores the flush never touches.
  • It does not fix a problem on the server’s side. If the site itself is down, a fresh lookup just gets you a fresh answer pointing at the same down server.

Flushing is a narrow tool: it fixes stale or corrupt cached lookups. For anything else on this list, it is the wrong step.

When to reach for it

A short decision rule. Flush your DNS when:

  • A specific site fails for you but works elsewhere, especially right after it changed hosts.
  • You just updated a domain’s DNS records and want to see the change without waiting for the TTL.
  • You suspect a corrupt or poisoned cache entry - unusual redirects for one domain.

Do not bother flushing when:

  • Your whole connection is down (fix connectivity first).
  • Every site is slow (that is bandwidth or the resolver, not the cache).
  • You want privacy (clear browser data instead).

Used for the right symptom, a flush is a five-second fix. Used as a reflex for every network problem, it is a placebo. Knowing the difference is the actual value of understanding what it does.

How this fits the rest of the stack

DNS caching and TTLs are the same mechanics that decide how quickly a domain change takes effect when you point a custom domain at a deployed app. Knowing that answers are cached with a TTL - and that your own machine may lag behind the change - turns propagation from a mystery into a countdown you can plan around. The RunxBuild hosting calculator lays out the service, database, storage, and bandwidth as separate line items, and the RunxBuild dashboard is where the team watches deploys, logs, and restarts as they happen.

Useful related references:

FAQ

What does flushing DNS do?

It clears your device’s local cache of domain-to-IP answers, so the next lookup for each site goes out fresh to a DNS server instead of reusing a stored answer. It fixes stale or corrupt cached records, such as when a site has moved to a new server, and does nothing else.

Does flushing DNS speed up the internet?

No. The cache already speeds things up by avoiding repeated lookups. Flushing briefly makes the next few lookups slower because the cache is empty and has to refill. It is a fix for stale answers, not a performance boost.

Will flushing DNS delete my browsing history or passwords?

No. Flushing only empties the DNS cache of name-to-address lookups. It does not touch browser history, cookies, saved passwords, or files - those are separate stores. To clear those, use your browser’s own clear-data settings.

When should I flush my DNS cache?

When a specific site fails for you but works for others - especially right after it changed hosting - or when you have just updated a domain’s DNS records and want to see the change without waiting for the TTL to expire. It is the wrong step for a down connection or general slowness.

How do I flush DNS on Windows, Mac, and Linux?

On Windows run ipconfig /flushdns. On macOS run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. On Linux run sudo resolvectl flush-caches (or sudo systemd-resolve --flush-caches on older systems). Each empties the local DNS cache.

#what does flushing dns do#dns#cache#networking#dev-infra