How To Clear Your DNS Cache: Resolve Errors and Speed Up Browsing

A computer screen showing a DNS error message, with a large broom or refresh icon above it. In the background, faded network symbols or IPs disappear — showing old data being cleared.
6 mins read
05 Jun 2025
6 mins read

How To Clear Your DNS Cache: Resolve Errors and Speed Up Browsing

If websites are loading slowly or throwing weird errors, your DNS cache might be the problem. It stores old data about websites you’ve visited, and sometimes that data gets outdated or corrupted. Clearing your DNS cache can fix connection issues, speed things up, and even protect you from some online risks. The best part? It only takes a minute — and we’ll show you how to do it on any device. 

Key Takeaways 

  • How to clear DNS cache on Windows, macOS, Linux, and Google Chrome 
  • Why DNS errors happen and how flushing helps fix them 
  • What DNS spoofing is — and how clearing the cache protects you 
  • When you should flush your DNS cache (hint: more often than you think) 

What Is a DNS Cache? 

Every time you visit a website, your device asks a DNS server to translate the web address (like example.com) into an IP address — something it can actually connect to. To save time, your system stores this information locally in what’s called a DNS cache. 

That way, the next time you visit the same site, it loads faster because your device doesn’t need to ask again. 

But here’s the catch:
Over time, this cache can get outdated or even corrupted. That’s when you start seeing problems — like pages not loading, getting redirected to old servers, or running into error messages. Flushing the cache clears all that out and forces your device to fetch fresh, up-to-date info. 

Why You Should Clear Your DNS Cache 

Clearing your DNS cache isn’t just a technical detail — it’s one of the easiest ways to fix everyday browsing issues. Here’s why it’s worth doing: 

Fixes Common Errors 

If you’ve run into problems like DNS_PROBE_FINISHED_NXDOMAIN or connection timeouts, outdated DNS data could be the cause. Flushing the cache can resolve these instantly. 

Loads the Latest Version of a Site 

When a website moves to a new server or changes hosting, your system might still point to the old location. Clearing the DNS cache helps your device find the updated address right away. 

Protects Against DNS Spoofing 

DNS spoofing is a security threat where attackers manipulate cached entries to send you to the wrong site. Flushing the cache helps prevent this by removing potentially corrupted data. 

Speeds Up Future Visits 

Once you clear outdated entries, your system fetches fresh DNS data and stores it again. This helps improve browsing performance and reliability. 

How To Clear DNS Cache on Windows 

Whether you’re using Windows 10 or 11, clearing your DNS cache only takes a few steps. Here’s how to do it: 

Step-by-Step: 

  1. Click the Start menu and search for Command Prompt. 
  2. Right-click it and choose Run as Administrator. 
  3. In the Command Prompt window, type the following and press Enter: 

bash 

CopyEdit

ipconfig /flushdns

     4. You’ll see a message confirming that the DNS Resolver Cache was successfully flushed. 

This action forces your computer to drop all old DNS records and fetch new ones the next time you visit a website. 

How To Clear DNS Cache on macOS 

Flushing the DNS cache on a Mac is just as easy — it just uses a different command. Here’s how to do it, no matter which macOS version you’re running: 

Step-by-Step: 

  1. Press Command + Space to open Spotlight Search. 
  2. Type Terminal and open the app. 
  3. In the Terminal window, enter this command and press Enter: 

nginx 

CopyEdit 

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

     4. Enter your Mac user password if prompted. 

You won’t see a success message, but the command works instantly in the background. 

Important: 

Different macOS versions use slightly different commands. Here’s what to use based on your version: 

  • Monterey, Big Sur, Catalina 

nginx 

CopyEdit 

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

  • Mojave, High Sierra, Sierra, El Capitan, Mavericks, Mountain Lion, Lion 

nginx 

CopyEdit 

sudo killall -HUP mDNSResponder

To check your version, click the Apple icon > About This Mac. 

How To Clear DNS Cache on Linux 

The steps to flush DNS cache on Linux depend on your distribution and version. Most modern systems use systemd-resolved, but some may rely on dnsmasq or nscd. 

Here’s how to clear the DNS cache on Ubuntu and similar distros: 

For Ubuntu 20.04 and earlier: 

  1. Open the Terminal with Ctrl + Alt + T. 
  2. Run the following command: 

arduino 

CopyEdit 

sudo systemd-resolve –flush-caches 
 

For Ubuntu 22.04 and newer: 

  1. Open Terminal. 
  2. Run this command: 

arduino 

CopyEdit 

sudo resolvectl flush-caches 

Tip: 

There’s no confirmation message, but the cache is cleared once the command finishes running. 

For other distributions (like Fedora or Arch), the command may vary slightly depending on the DNS service in use. If systemd isn’t used, you might need to restart dnsmasq or nscd manually. 

How To Clear DNS Cache in Google Chrome 

Even if you clear your system’s DNS cache, Chrome stores its own DNS data separately. If you’re having trouble loading websites in Chrome, it’s a good idea to flush the browser’s cache too. 

Here’s how to do it: 

  1. Open Google Chrome. 
  2. In the address bar, type this and press Enter: 

bash 

CopyEdit 

chrome://net-internals/#dns 

     3. You’ll see a page titled DNS. 

     4. Click the Clear host cache button. 

That’s it. Chrome will now drop any stored DNS entries and fetch fresh data the next time you visit a website. 

Common DNS Errors and How Flushing Helps 

When your DNS cache stores outdated or incorrect data, it can lead to frustrating browsing problems. Here are some of the most common errors — and how clearing the cache can help: 

DNS_PROBE_FINISHED_NXDOMAIN 

This usually means your device can’t resolve a domain name. It often happens when the cached DNS record no longer matches the site’s real IP. Flushing the cache forces your system to get the correct address. 

ERR_NAME_NOT_RESOLVED 

This error appears when the DNS lookup fails completely. A stale or broken DNS entry is a common cause. Clearing the cache often fixes it immediately. 

Connection Timed Out 

If your browser keeps waiting and never connects, your system might be using the wrong IP address. Flushing the cache removes bad data and gives your browser a fresh start. 

404 Errors on Sites That Should Work 

Sometimes, you’ll see a “Page Not Found” error on a website that’s working fine for others. This can happen if your DNS cache is pointing to an old version of the site. A flush will resolve it. 

FAQs About DNS Cache 

Is clearing the DNS cache safe? 

Yes. It won’t delete your files, saved passwords, or browser history. It only removes outdated DNS lookup data. 

How often should I flush my DNS cache? 

There’s no fixed rule, but it’s smart to do it when: 

  • You change DNS settings or providers 
  • Websites stop loading properly 
  • You see DNS-related error messages 

Will clearing the DNS cache affect my browsing? 

Only slightly at first. The next time you visit a website, your system will take a moment to fetch new DNS data. After that, it’ll speed up again. 

How do I know if the DNS cache was cleared successfully? 

On Windows, you’ll see a confirmation message. On macOS and Linux, there’s no message — but if you typed the command correctly, it works instantly. 

Does Chrome have a separate DNS cache? 

Yes. Even if you flush your system’s cache, Chrome may still store DNS info. Use chrome://net-internals/#dns to clear it. 

Final Tips for Smooth Browsing

Flushing your DNS cache is one of the simplest ways to fix connection issues, load websites faster, and protect against certain security risks. It’s a small step that can solve problems before they get bigger. 

Here’s a quick recap: 

  • Clear your DNS cache if websites stop loading or errors appear 
  • Always flush after changing DNS settings or switching providers 
  • Don’t forget that browsers like Chrome store DNS data too 
  • It’s a good habit to clear your cache every few weeks — especially if you work online daily 

Staying on top of your DNS cache is like giving your internet connection a quick tune-up. It’s fast, safe, and can save you hours of frustration. 

Picture of Vladislav S.
Vladislav S.

Reviewer

Hey! I’m a content marketer with a passion for tech and social media. I write easy-to-digest articles and tips to help you stay sharp online — whether you're growing your brand or just love cool tech stuff. My goal is to make complicated things simple and useful. Let’s make digital life a little smarter (and a lot more fun)!

Join the Pixelscan Community

Join our growing community on Telegram to stay informed, share your thoughts, and engage with others.

Share with

Hey! I’m a content marketer with a passion for tech and social media. I write easy-to-digest articles and tips to help you stay sharp online — whether you're growing your brand or just love cool tech stuff. My goal is to make complicated things simple and useful. Let’s make digital life a little smarter (and a lot more fun)!

Recent posts

https://pixelscan.net/blog/how-to-clear-dns-cache/

Join the Pixelscan Community

Join our growing community on Telegram to stay informed, share your thoughts, and engage with others.