How to Clear DNS Cache on Any Device
It's a familiar, frustrating moment: you try to load a website you visit every day, but your browser hits a wall. Suddenly, you're staring at an error page. The good news? The fix is often surprisingly simple and takes just a few seconds: you need to clear your DNS cache. Think of it as hitting a quick reset button for your device's internet connection.
Why Flushing Your DNS Cache Is Your Go-To Internet Fix

So, what exactly is this magic fix? Your device keeps a local "address book" for the internet called the DNS (Domain Name System) cache. Every time you visit a site, your computer saves its IP address in this cache. This is great for speed—on your next visit, your device already knows where to go without having to ask for directions again.
But just like a real address book, the information can get old.
When Good Cache Data Goes Stale
Let's say your favorite online store upgrades its servers. Its IP address—its location on the internet—changes. Your device, however, might still be clinging to the old, outdated address in its DNS cache. When you try to visit, your browser confidently follows the old directions, ends up at an empty lot, and gives you a "site not found" error.
This is precisely where clearing the DNS cache works wonders. It’s the digital equivalent of telling your device, "Toss out that old address book and get fresh directions from now on." You'd be surprised how many connection headaches this one action can cure.
Flushing your DNS cache forces your device to ditch its outdated list of website addresses. This simple step makes it fetch the correct, current IP address, instantly fixing a wide range of frustrating loading and connection errors.
It’s a remarkably effective solution for what feels like a major internet meltdown. In my experience, it’s one of the first things I recommend to friends and family. A quick flush can resolve issues for roughly 40% of users with spotty connection problems, and since DNS lookups can account for up to 30% of page load time, a clean cache can make a real difference.
Common Problems Solved by Clearing Your DNS Cache
A quick DNS flush is more than just a fix for 404 errors. It's a versatile troubleshooting step that can solve several annoying and even risky issues. Here’s a quick rundown of common problems and how clearing the cache helps.
| Problem You Are Facing | How Clearing DNS Cache Helps | Real-World Example |
|---|---|---|
| Website Won't Load | Your device has an old, incorrect IP address saved for the site. | A news site moves to a new server. You can't access it, but your friend can. Clearing your cache lets your device find the new address. |
| Security Risks | Protects you from "DNS spoofing," where attackers poison your cache to send you to fake, malicious sites instead of legitimate ones. | You try to visit your bank's website but are redirected to a phishing page. Flushing the cache helps ensure you land on the real site. |
| Seeing Outdated Content | The site has been updated (new design, new articles), but your device keeps loading the old, cached version. | A blog you follow just got a redesign, but it still looks the same to you. Clearing the cache forces your browser to grab the latest version. |
These are just a few examples, but they cover the most frequent reasons you'd want to perform this quick maintenance task.
To dig deeper into the "why" behind this fix, it helps to have a basic grasp of DNS propagation and caching. And if you ever find yourself in a tricky situation where your WiFi is connected but you have no internet access, clearing the DNS cache is an excellent first troubleshooting step to try.
Clearing the DNS Cache on Windows

If you're on a Windows machine, knowing how to clear the DNS cache is one of the quickest and most effective troubleshooting tricks in the book. The whole thing takes less than a minute, and you'll use a built-in tool called the Command Prompt.
To get this done, you need to open the Command Prompt with the right permissions. It’s a simple security step to make sure only authorized users are fiddling with network settings.
Opening Command Prompt with Administrator Rights
Getting administrator-level access is straightforward.
Just hit the Windows key or click the Start Menu and type cmd into the search bar. You'll see "Command Prompt" pop up. Instead of just clicking it, right-click the icon and choose "Run as administrator."
Windows will ask for your permission with a User Account Control pop-up. Simply click "Yes," and a black terminal window will open, ready for your command.
Executing the DNS Flush Command
Now for the easy part. With the Command Prompt open, you're going to type a single, simple command. This works on all modern versions of Windows, including Windows 11 and 10.
Type the following line exactly as you see it, then press Enter:
ipconfig /flushdns
Almost immediately, you’ll get a confirmation message.
Successfully flushed the DNS Resolver Cache.
That’s it! This message confirms that Windows has wiped its slate clean of old DNS records. The next time you visit a website, your computer will have to fetch fresh information, which often clears up those stubborn connection or loading errors.
If you've flushed the cache and are still running into trouble, the problem might lie elsewhere in your network settings. A good next step is often to reset your network adapter in our guide, as this can solve a different class of connectivity issues.
Flushing DNS on macOS and Linux Systems
If you're a Mac or Linux user, you're not left out. Clearing your DNS cache is just as simple as on Windows, but your tool of choice will be the Terminal. Think of the Terminal as a direct line to your computer's brain—it's a command-line interface that lets you give precise instructions.
It might look a little intimidating at first, but with just one quick command, you can knock out a whole host of frustrating connection problems.
Clearing the DNS Cache on a Mac
For anyone running a modern version of macOS, like Ventura or Monterey, the command is a simple one-liner. You'll just need to open the Terminal app. The fastest way to find it is with a Spotlight Search (just hit Cmd + Space) and type "Terminal."
Once the Terminal window pops up, type or paste in this command and hit Enter:
sudo killall -HUP mDNSResponder
The sudo part of that command stands for "superuser do," which essentially tells your Mac you have the authority to make this kind of system-level change. Because of this, it will ask for your password. Don't be alarmed when you don't see any characters appear as you type—that’s a standard security measure. Just type your password correctly and press Enter.
Pro Tip: Unlike Windows, your Mac won't give you a "success!" message. If you want to be absolutely sure it worked, here’s a little trick I use: open the Console app, select your device in the sidebar, and search for "mDNSResponder." You should see fresh activity logs showing that the service just restarted, which confirms the cache is clear.
How to Clear DNS Cache on Linux
For the Linux crowd, the process is quite similar, especially if you're on a popular distribution like Ubuntu that uses the systemd service manager. Fire up your terminal and run this command:
sudo systemd-resolve --flush-caches
This command directly instructs the systemd-resolved service, which handles your system's name resolution, to dump its old cache. Like on macOS, you’ll need to enter your password to authorize the sudo command. It’s an incredibly handy tool for developers and system administrators who can't afford to wait for DNS changes to propagate on their own. For example, after you change the hostname in Linux, running this command ensures the new name is recognized across the network right away.
These commands are workhorses for a reason. On Apple Silicon Macs, this simple flush can resolve an estimated 50% of weird network glitches that often crop up after a system update. For server admins, the Linux command is a go-to, preventing propagation failures in around 80% of cases. If you're looking for more privacy on your network, you might also find this guide on how to make your own VPN at home useful.
We've all been there: a website works just fine on your computer but refuses to load on your phone. It's a classic troubleshooting headache. This isn't just random bad luck—it's often because your browser and mobile device have their own separate DNS caches, a detail that trips up a lot of people. Flushing your computer's DNS is only half the job.
Most modern browsers, from Google Chrome to Firefox, keep their own DNS records to make web pages load faster. The problem is, when this data gets old or corrupted, the browser's cache can actually clash with your operating system's updated information, leading to those baffling connection errors.
Clearing Your Browser's DNS Cache
Forcing your browser to dump its internal DNS is thankfully pretty simple. Each one has a hidden internal page specifically for this—it’s completely different from just clearing your browsing history or cookies.
- Google Chrome: Just pop
chrome://net-internals/#dnsinto your address bar and hit Enter. You’ll see a page with a “Clear host cache” button. Click it, and Chrome’s DNS records are gone instantly. - Microsoft Edge: Since Edge is now built on the same Chromium foundation as Chrome, the steps are identical. Head to
edge://net-internals/#dnsand click the “Clear host cache” button. - Mozilla Firefox: Firefox does things a little differently. You'll need to go to
about:configin the address bar. After you accept the warning, search fornetwork.dns.disablePrefetchand double-click it to set the value totrue. Wait a second, then double-click it again to set it back tofalse. This little toggle effectively flushes the cache.
Combining a browser flush with an OS flush is a powerful one-two punch. For Chrome alone, which has over 1.2 billion users, this "dual-flush" method is a game-changer. Tech support forums often suggest this simple combo can fix up to 60% of stubborn connectivity issues, especially when you've just switched to a new network or started using a VPN.
Quick DNS Fixes for Android and iOS
Your phone is just as prone to outdated DNS records as your desktop. If you’re pulling your hair out trying to get a website to load on Wi-Fi or cellular, the phone's cache is almost always the place to look first.
The diagram below gives a great visual of how this works on macOS and Linux, showing the specific commands you'd use in the terminal for each.

As you can see, even on powerful operating systems like these, it boils down to a single command. But for mobile, the fix is often even easier.
For both Android and iOS devices, there's a surprisingly effective trick I recommend trying first:
Toggle Airplane Mode on, wait about 30 seconds, and then turn it back off. This simple action forces your phone to completely disconnect from all networks and then reconnect, which resets the network connection and clears out the DNS cache at the same time.
On Android, you have another option. You can go into Settings > Apps, find your web browser (like Chrome), tap on "Storage & cache," and then hit "Clear cache." This is a great targeted fix that only wipes that specific app's temporary data.
For iOS, your options are a bit more limited outside of the Airplane Mode trick. The most definitive way is to go to Settings > General > Transfer or Reset iPhone > Reset > Reset Network Settings. This absolutely will flush the DNS, but use this as a last resort. It wipes all of your saved Wi-Fi networks and passwords, which is a major pain to set up again. Before you go that route, it might be worth checking out some other options in our guide on how to clear the cache on an iPhone.
Knowing When to Flush Your DNS Cache
Knowing the commands to clear your DNS is one thing, but the real skill is knowing when it’s the right tool for the job. Flushing your DNS isn't just a troubleshooting step for when a website won't load; it's a simple bit of maintenance that keeps your internet experience smooth and secure. Think of it less as a last-ditch effort and more like a regular digital tune-up.
So, when should a DNS flush be your go-to move? Here are a few classic signs that your device's cache needs a refresh.
Fixing Obvious Connectivity Errors
This is the big one. You try to visit a familiar website—say, your favorite news site or a social media platform—but all you get is a "This site can’t be reached" error or a generic 404 page. You know the site is up because your friend across town can access it just fine, but for you, it's a digital dead end.
This almost always points to an outdated DNS record. Your computer is clinging to an old, incorrect IP address for that website. A quick flush forces your system to forget that bad data and ask for the site's correct, current address. More often than not, this solves the problem in seconds. If that doesn't work, our guide on how to troubleshoot your internet connection offers other common fixes.
Enhancing Your Online Security
Here’s a reason you might not think of: security. Cybercriminals can use a nasty trick called DNS spoofing (or cache poisoning) to hijack your connection. They essentially trick your device into storing a malicious IP address for a perfectly legitimate website.
Imagine you type in your bank's web address. If your DNS cache has been poisoned, you could be sent to a convincing fake site built to steal your username and password. It's a sneaky and incredibly effective attack.
By flushing your DNS cache regularly, you wipe out any malicious entries that might have been planted there without your knowledge. It’s a simple, proactive step that adds a strong layer of defense against phishing and spoofing.
Think of it as part of your digital hygiene routine, just like clearing your browser cookies, but for your network connection itself.
Seeing Recent Website Updates
This one is especially familiar to web developers, designers, or anyone who keeps a close eye on a site that's changing. When a website gets a major overhaul or moves to a new server, its IP address often changes along with it.
Your device, always trying to be efficient, might keep loading the old, cached version from its memory. This can leave you looking at an outdated design, wondering why you can't see the slick new layout everyone is talking about. Clearing the DNS cache forces your computer to fetch the latest version of the site directly from its new home, ensuring you see it just as it's meant to be seen.
Frequently Asked Questions About DNS Caching
Okay, so you know how to flush your DNS cache. But a few common questions always seem to follow. You've mastered the command, but now you're probably wondering when you should actually use it, or what to do if it doesn't solve your problem.
Let's clear up some of that lingering confusion. I've heard these questions countless times, and they're all valid points.
How Often Should I Clear My DNS Cache?
Honestly, there’s no set schedule for this. The right frequency really depends on what you’re doing. For most of us, it’s not something you need to do regularly.
My rule of thumb is to treat it as a reactive tool.
- For Everyday Browsing: Only flush your DNS when you run into a problem. If a website you use all the time suddenly won't load, you're seeing an old version of a page, or you get a strange 404 error on a site you know is live, that's your cue. Otherwise, just let it be.
- For Developers and Website Owners: You'll be doing this a lot more. Flushing the DNS is practically a reflex action anytime you update DNS records, launch a new site, or migrate a server. It’s the fastest way to force your machine to see the changes you just made.
Think of it like this: casual users flush the cache to fix an issue, while technical users flush it to prevent one by seeing their updates immediately.
Will Flushing My DNS Delete My Files or History?
This is probably the most common worry I hear, and I get it. The good news is, the answer is a firm no. Flushing your DNS cache is completely safe and won't touch your personal files, browser history, bookmarks, or saved passwords.
The process is incredibly specific. It only targets the temporary list of IP addresses your computer has saved.
Clearing your DNS cache is a network-level action. It simply erases stored IP address lookups. It does not interact with your browser's data, your documents, photos, or any other personal information on your device.
So go ahead and use ipconfig /flushdns or its equivalent on macOS and Linux with confidence. It's one of the safest troubleshooting steps in the book and won't cause any data loss.
What If Clearing the Cache Didn't Fix the Problem?
You've flushed the DNS, got the "successfully flushed" message, and... the website still won't load. It's frustrating, but it’s also a valuable clue. It tells you the problem probably isn't with your device's local cache. So, what’s next on the checklist?
Here's the troubleshooting path I usually follow:
- Restart Your Router: People often forget that their router has its own DNS cache. The easiest fix is to simply unplug it from the wall, wait about 30 seconds (don't rush it!), and plug it back in. A quick reboot like this solves a surprising number of stubborn connection problems.
- Check If the Website Is Down: Before you go any further, make sure the site itself isn't the problem. Use a third-party service like a down detector website to see if other people are reporting an outage for that specific domain.
- Try a Different DNS Server: Sometimes, your Internet Service Provider's (ISP) DNS servers are the culprit—they might be slow, overloaded, or experiencing a regional issue. You can temporarily switch to a public DNS provider like Google's (8.8.8.8) or Cloudflare's (1.1.1.1) to see if that bypasses the problem.
If you've tried all three and are still stuck, the issue might be more complex. But in my experience, these steps will resolve the vast majority of problems that a simple cache flush doesn't catch.
At Simply Tech Today, we believe in making technology simple and accessible. For more straightforward guides and practical tips, visit us at https://www.simplytechtoday.com.
Member discussion