Table of Contents >> Show >> Hide
- What does flushing DNS actually do?
- When should you clear DNS cache?
- Before you flush: know which cache you are clearing
- How to flush DNS on Windows
- How to flush DNS on macOS
- How to flush DNS on Linux
- How to clear browser DNS cache
- Routers, public DNS resolvers, and the cache you cannot always control
- How to confirm the flush worked
- Common mistakes people make when flushing DNS
- Real-world experiences: what flushing DNS fixes, what it does not, and why it matters
- Final thoughts
Sometimes the internet feels like it is gaslighting you. You change a website’s IP address, update a DNS record, move a domain to a new server, or fix a broken local hostname, and your computer still insists on visiting the old destination like it is emotionally attached to it. That is usually not magic. It is DNS cache.
Flushing DNS clears saved domain-name lookups so your device asks for fresh answers instead of clinging to old ones. In plain English, it tells your computer, browser, or resolver, “Forget what you think you know. Ask again.” That can fix problems like websites not loading, domains pointing to the wrong server, stale records after a migration, or weird “site not found” errors that only happen on one device.
Note: Different systems cache DNS in different places. Sometimes you need to clear the operating system cache. Sometimes the browser has its own host cache. Sometimes your router or public resolver is the stubborn one. The trick is clearing the right cache, not just clearing something and hoping for the best.
What does flushing DNS actually do?
DNS, or the Domain Name System, translates human-friendly domain names into IP addresses that devices can use. To speed things up, operating systems, browsers, and resolvers save those answers for a while. That is the cache. Most of the time, this is helpful. It makes lookups faster and cuts down on repeated trips across the network.
The trouble starts when the cached answer is stale, incorrect, or negative. A negative cache entry means your system remembers that a lookup failed, so it keeps failing even after the domain is fixed. That is why flushing DNS can be surprisingly satisfying: it wipes the resolver’s short-term memory and forces a fresh lookup.
What it does not do: it does not clear your browsing history, erase cookies, improve Wi-Fi speed by itself, or fix every networking problem known to humankind. If your internet is down, your router is broken, or the DNS record has not fully propagated yet, a DNS flush alone will not save the day.
When should you clear DNS cache?
Flushing DNS is worth trying when:
- a website opens on your phone but not on your computer,
- you changed a domain’s DNS records and still see the old site,
- you edited your hosts file and the change is ignored,
- you keep getting “server not found,” “DNS probe finished,” or similar resolver errors,
- you moved a site to a new host and your browser is clinging to the old IP like a bad ex,
- you are troubleshooting VPN, proxy, or secure DNS issues.
Before you flush: know which cache you are clearing
There is more than one kind of DNS cache, and that is where many guides get sloppy.
- Operating system cache: Windows, macOS, and many Linux setups keep a local resolver cache.
- Browser host cache: Chrome-based browsers and Firefox can keep their own DNS data.
- Router cache: Some routers cache DNS responses too.
- Public resolver cache: Services like Google Public DNS or your ISP’s resolver may cache records upstream.
If your goal is to see a newly changed domain record, you may need to clear more than one layer. That is why someone on the same network can see the new site while your laptop still sees the old one. DNS is efficient, but it can also be dramatically stubborn.
How to flush DNS on Windows
Windows 11 and Windows 10
Windows makes this easy. Open Command Prompt as Administrator, then run:
If Windows is cooperating, you should see a success message telling you the DNS resolver cache was flushed. This clears the local DNS client cache, including dynamically added entries and negative cache entries.
If you are troubleshooting a larger network problem, you can also refresh your DHCP lease after flushing:
This combo is useful when your machine has the wrong network details, your connection recently changed, or your system seems confused about where it lives on the network. Think of it as giving Windows a small networking pep talk.
Windows Server: clearing the server cache is different
If you are running the DNS Server role on Windows Server, that is a different cache from the normal client cache. In that case, the server-side PowerShell command is:
That matters because clearing the client cache on your workstation will not clear a DNS server’s cache, and clearing the server cache will not magically fix stale entries sitting in a browser.
Windows tips if flushing does not help
- Close and reopen the browser.
- Check whether your browser has its own host cache.
- Confirm the DNS servers your adapter is actually using.
- Test with
nslookupto see which IP address is being returned.
How to flush DNS on macOS
macOS is a little more dramatic. The command can vary by version, but on modern macOS releases, the most common approach is:
Enter your password when prompted. Usually, macOS does not give you a flashy success message, which feels very on-brand. No fireworks, no confetti, just a quiet return to the prompt. That is normal.
The first command clears the directory service cache, and the second signals mDNSResponder, the service that handles much of macOS name resolution behavior. Together, they are the standard first move when a Mac appears to be using stale DNS data.
If your Mac still sees the old address
Try these follow-up steps:
- quit and reopen Safari, Chrome, or Firefox,
- toggle Wi-Fi off and back on,
- disconnect from and reconnect to VPN if you use one,
- restart the Mac if a resolver process seems stuck,
- check whether the browser is using DNS over HTTPS or another private resolver path.
On Macs, the browser layer is often the part people forget. They flush the system cache, then stare at the browser in betrayal while it keeps using the old answer.
How to flush DNS on Linux
Linux is where DNS flushing stops being one recipe and starts becoming a choose-your-own-adventure book. The correct command depends on which resolver or cache daemon your distribution is using.
Most modern Ubuntu, Debian, Fedora, and many other systems: systemd-resolved
If your system uses systemd-resolved, run:
If you want to reset learned server behavior as well, you can follow up with:
This is often the right answer on newer desktop and server setups that use systemd-resolved under the hood.
Systems using nscd
If your machine uses the Name Service Cache Daemon, invalidate the hosts cache with:
On some systems, restarting the service also works:
Systems using dnsmasq
If dnsmasq is acting as your local caching resolver, the most practical approach is usually to restart it:
In NetworkManager-managed setups where dnsmasq is embedded through NetworkManager, you may need:
Linux is flexible, which is a polite way of saying there are twelve correct answers and three of them are hidden behind a service you forgot was installed in 2023.
How to find out what your Linux box is using
Whichever one is active is the service you care about. Flush the resolver you actually use, not the one a random forum post used five years ago.
How to clear browser DNS cache
Even after flushing the operating system cache, your browser may still keep its own host cache. If you are testing a site migration, hosts file change, or internal DNS tweak, clearing the browser cache can be the missing step.
Chrome, Chromium, and ChromeOS
In the address bar, open:
Then click Clear host cache.
This is especially handy on Chromebooks and Chrome-based browsers where the browser-level cache can keep serving stale results after the OS cache is already fresh.
Firefox
In the address bar, open:
Then use the button to clear the DNS cache.
If Firefox is using DNS over HTTPS, remember that it may not behave exactly like the system resolver. In that situation, flushing the operating system cache alone may not be enough. If you are testing internal domains, a local resolver, or a hosts file change, check Firefox’s DoH settings too.
Routers, public DNS resolvers, and the cache you cannot always control
Here is the part many users discover only after yelling at their laptop for twenty minutes: sometimes your device is not the problem. Your router may cache lookups. Your ISP may cache lookups. A public resolver such as Google Public DNS may cache lookups upstream according to TTL rules. That means a local flush may work perfectly and still not change the answer you receive from farther up the chain.
If your router is acting as the DNS forwarder, rebooting it can help clear stale local resolver data. If you are a domain owner using Google Public DNS and you recently changed authoritative records, Google provides a public cache flush tool for domain-level refresh requests. Regular users, however, generally cannot force every public resolver on Earth to forget a record instantly. DNS propagation is still governed by TTL values and caching behavior.
That is why “I flushed DNS and it still shows the old site” does not always mean the flush failed. Sometimes the record is still cached elsewhere, or the authoritative source has not fully updated across the path yet.
How to confirm the flush worked
After clearing the cache, test the result instead of relying on vibes.
Windows
macOS and Linux
Compare the returned IP address with the one you expect. If the address is still wrong, ask these questions:
- Did I flush the OS cache, the browser cache, or both?
- Am I behind a VPN, proxy, or secure DNS service?
- Is the router or upstream resolver caching the old result?
- Has the DNS change actually propagated yet?
- Did I update the right record in the first place?
Common mistakes people make when flushing DNS
- Confusing DNS cache with browser cache: clearing cookies is not the same thing.
- Ignoring the browser’s own resolver: especially in Chrome and Firefox.
- Forgetting negative cache entries: a previous failure can stick around.
- Assuming propagation is instant: TTL still matters.
- Skipping admin privileges: some commands need elevated access.
- Using the wrong Linux command: because Linux loves variety more than consistency.
Real-world experiences: what flushing DNS fixes, what it does not, and why it matters
In real life, flushing DNS often shows up during the least convenient moments. A developer updates a staging site and keeps landing on the old server. A small business moves its website to a new host, and half the office can see the new homepage while the other half keeps seeing last week’s version. A student edits a hosts file for local development, swears the entry is correct, and then loses an hour because the browser is still serving a cached lookup like a tiny, determined troll.
One of the most common experiences is the “works on my phone, fails on my laptop” mystery. That usually points to caching. The phone asks for a fresh answer and reaches the new IP, while the laptop keeps using an older cached record. In cases like that, a DNS flush can feel magical because it fixes the problem in seconds. It is not really magic, of course. It is just finally forcing the computer to stop being confidently wrong.
Another very common situation happens after changing DNS providers or moving nameservers. People flush their local cache and expect the entire internet to update instantly. That is where experience teaches patience. Flushing helps your device, but it does not override TTL values at every upstream resolver. So yes, it is possible to do everything “right” and still see mixed results for a while. That is not failure. That is DNS being DNS.
There are also cases where flushing DNS does absolutely nothing, and that is useful information too. If a flush does not change the result, you may be looking at the wrong layer. Maybe the router is caching. Maybe the browser is using secure DNS. Maybe the VPN is sending lookups through a different resolver. Maybe the authoritative record is still wrong. A failed DNS flush is not wasted effort; it narrows the search.
System administrators and developers learn this quickly. They stop treating DNS as one single cache and start thinking in layers. Client cache. Browser cache. Forwarder cache. Recursive resolver cache. Authoritative answer. Once you see the stack clearly, troubleshooting gets much faster.
The practical lesson is simple: flushing DNS is one of the best first-line fixes for domain resolution weirdness, but it works best when you know which cache is stale. Clear the correct layer, verify the returned IP, and do not let one stubborn browser tab convince you the whole network is broken. Sometimes the solution is a command. Sometimes it is a browser setting. Sometimes it is waiting for propagation and eating a snack while the TTL expires.
That may not sound glamorous, but it is real-world DNS troubleshooting in a nutshell: part science, part patience, part muttering, “Why are you still going to the old server?” at a machine that definitely cannot hear you. Probably.
Final thoughts
If you remember only one thing, remember this: flushing DNS is not about clearing random internet dust. It is about forcing a fresh name-resolution lookup when cached DNS data is old, wrong, or no longer useful. On Windows, it is usually one command. On macOS, it is two commands and a little faith. On Linux, it depends on the resolver service in charge. In browsers, it may require a separate host-cache clear. And when nothing changes, the problem may be sitting farther upstream.
Use the right command for the right resolver, verify the result with a lookup tool, and you will solve most stale-DNS headaches faster than the average person can finish saying, “But I already restarted the browser.”