How to Flush DNS Cache (Windows, macOS, Linux, Browsers)

Ever tried opening a website, and it just won’t load, or you get a 404 error even though the site works on other devices? The culprit might be your DNS cache. Don’t worry—it’s an easy fix, and you can do it in minutes.

This guide will explain what DNS cache is, why it can cause problems, and how to clear it on Windows, macOS, Ubuntu, Linux, and even in browsers.

What Is DNS Cache?

Think of the internet like a huge phonebook. You type in www.example.com, but your computer doesn’t understand words—it understands numbers called IP addresses.

Your computer keeps a little memory of recently visited websites called DNS cache, so the next time you visit, it loads faster.

But sometimes this cache gets stale or corrupted, which can cause:

  • Websites not loading
  • Pages loading incorrectly
  • 404 errors
  • Slow browsing

Flushing the DNS cache is like clearing old addresses from your phone so your computer can look up the latest ones.

Why Flush DNS?

You should flush your DNS when:

  • Websites keep loading incorrectly
  • Switching networks or VPNs
  • Changing DNS settings
  • Suspecting malware or network issues

Using the DNS flush command is the fastest way to fix these problems.

How to Flush DNS on Windows 10 (ipconfig /flushdns)

  1. Press Windows + R, type cmd, and press Enter.
  2. Right-click Command Prompt and select Run as Administrator.
  3. Type the command: ipconfig /flushdns
  4. Press Enter. You should see: “Successfully flushed the DNS Resolver Cache.”
Flush DNS on Windows 10

Optional Commands:

  • To view current DNS cache: ipconfig /displaydns
  • To reset network settings: use netsh winsock reset

Flush DNS Cache on MacOS

To clear DNS on MacOS, follow these steps:

  1. Open Applications → Utilities → Terminal.
  2. In the Terminal window, type: sudo killall -HUP mDNSResponder
  3. Press Enter, type your administrator password, and press Enter again.
  4. Your DNS cache is now cleared, and your Mac will use updated DNS records.

Note: Older macOS versions may use different commands.

How to Flush DNS on Ubuntu and Linux

Ubuntu (Network Manager)

  1. Press Ctrl + Alt + T to open the Terminal.
  2. Type: sudo service network-manager restart
  3. Press Enter and type your administrator password when prompted.
  4. Press Enter again. Your DNS cache is now cleared.

This command restarts the Network Manager service, which refreshes your DNS settings and ensures your system uses the most up-to-date records.

Other Linux distributions (NSCD)

  1. Open Terminal.
  2. Type: sudo /etc/init.d/nscd restart
  3. Press Enter.

Different Linux distributions use different services; check which one your system uses.

Clear DNS Cache in Browsers

Even after flushing your system’s DNS cache, browsers often store their own cached information. This can cause websites to load outdated pages or show errors. Clearing your browser’s cache ensures you access the latest version of websites.

Google Chrome

  1. Open Chrome and go to: chrome://net-internals/#dns
  2. Click Clear host cache.
  3. Optionally, restart Chrome to make sure changes take effect.

Mozilla Firefox

  1. Open Firefox and go to Preferences → Privacy & Security.
  2. Scroll to Cookies and Site Data and click Clear Data.
  3. Check Cached Web Content and click Clear.

Microsoft Edge

  1. Open Edge and go to Settings → Privacy, search, and services.
  2. Under Clear browsing data, click Choose what to clear.
  3. Select Cached images and files and click Clear now.

Tip: Clearing browser cache along with the system DNS cache helps fix slow-loading websites, 404 errors, and outdated content issues.

Quick Cheat Sheet for Flushing DNS

PlatformCommand/Action
Windows 10ipconfig /flushdns
MacOSsudo killall -HUP mDNSResponder
Ubuntusudo service network-manager restart
Linux (NSCD)sudo /etc/init.d/nscd restart
Chromechrome://net-internals/#dns → Clear host cache

How do I flush DNS on Windows 10?

Open Command Prompt as admin, type ipconfig /flushdns, and press Enter.

Does flushing DNS speed up my internet?

It won’t make your internet faster, but it fixes errors caused by old or corrupted DNS records.

How often should I flush DNS?

Only when websites won’t load correctly, after changing networks, or updating DNS settings.

Can I flush DNS on browsers too?

Yes! Chrome, Firefox, and Edge all have separate caches that can affect loading.

What does flush DNS mean?

Flushing DNS clears the stored DNS records (IP addresses of websites) on your computer. This forces the system to look up fresh DNS information the next time you visit a site.

Is it safe to flush DNS?

Yes. Flushing DNS is completely safe. It doesn’t affect your files or system — it only removes outdated or corrupted DNS entries.

Will a reboot flush DNS?

Not always. Restarting may clear some temporary cache, but the DNS resolver cache often persists until you explicitly run the flush command.

Flushing DNS is a quick, effective way to fix stubborn internet issues and make sure your computer is looking up the newest website addresses.

Leave a Reply

Your email address will not be published. Required fields are marked *