How to Flush DNS Cache on Windows, Mac, Linux & Browsers

How to Flush DNS Cache on Windows, Mac, Linux & Browsers

How to Flush DNS: A Step-by-Step Guide for Windows, macOS, Linux, and Web Browsers

If you’ve ever experienced website loading issues, slow browsing speeds, or seen the dreaded “DNS_PROBE_FINISHED_BAD_CONFIG” error, you’re not alone. These issues often stem from problems with the Domain Name System (DNS).

Thankfully, there’s a simple solution—flushing your DNS cache. This guide will walk you through everything you need to know about flushing DNS, why it’s important, and how to do it on various platforms, including Windows, macOS, Linux, and web browsers.

Understanding DNS cache and how to flush it can be a valuable tool for troubleshooting internet connection problems like inaccessible websites and 404 errors. This risk-free procedure can also offer additional security benefits.

This article will first explain what DNS cache is, then provide instructions for flushing it across various operating systems and web browsers.

What Is DNS, and Why Does Flushing It Matter?

DNS is like the phonebook of the internet. It translates human-friendly domain names (like www.aveshost.com) into IP addresses that computers use to communicate. Your device stores these translations in a DNS cache to speed up browsing.

However, over time, this cache can become outdated or corrupted, leading to browsing issues. Flushing the DNS cache removes old data and forces your device to fetch fresh DNS records, solving many connectivity problems.

Common Reasons to Flush Your DNS Cache

Flushing your DNS cache can resolve several issues:

  1. Website problems: Clearing the cache forces your system to retrieve fresh website information from the DNS server, resolving potential errors or corrupted data.
  2. DNS spoofing: Resetting your DNS ensures your system uses valid records, preventing redirection to malicious websites due to DNS manipulation.
  3. DNS server changes: Flushing the cache removes outdated information from your previous DNS server, preventing conflicts when switching providers.
  4. Faster DNS propagation: if you host a website, flushing the DNS on your local machine can speed up access to your site after updates by forcing a refresh of DNS information.

How to Flush DNS Cache on Different Operating System (OS)

Flushing the DNS cache requires different steps depending on your operating system. Below, we outline the process for the three most common OSs: Windows, macOS, and Linux.

How to Flush DNS Cache in Windows

For Windows, the steps to flush the DNS cache are generally consistent across most versions, particularly the newer ones. Here’s how you can do it:

For Windows 10 and 11:

  1. Press Win + S to open the search bar.
  2. Type Command Prompt, right-click it, and select Run as Administrator.
  3. In the Command Prompt, type: ipconfig /flushdns
  4. Press Enter. You’ll see a confirmation message: “Successfully flushed the DNS Resolver Cache.”
How to Flush DNS Cache in Windows

For Older Windows Versions:

The process is similar, but ensure your Command Prompt is running with administrative privileges.

How to Flush DNS Cache in macOS

  1. Open Terminal from Applications > Utilities.
  2. Based on your MacOS version, type the following command to flush the DNS cache:
    • macOS Big Sur (11), Monterey (12), Ventura (13), Sonoma (14), and Sequoia (15): sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
    • macOS El Capitan (10.11), Sierra (10.12), High Sierra (10.13), Mojave (10.14), or Catalina (10.15): sudo killall -HUP mDNSResponder
    • macOS Yosemite (10.10): sudo discoveryutil udnsflushcaches
    • macOS Lion (10.7), Mountain Lion (10.8), or Mavericks (10.9): sudo killall -HUP mDNSResponder
    • macOS Snow Leopard (10.6): sudo dscacheutil -flushcache
    • macOS Leopard (10.5): sudo lookupd -flushcache
  3. Enter your admin password when prompted.

For Older macOS Versions:

Use this command in Terminal:

sudo killall -HUP mDNSResponder

No confirmation message appears, but the DNS cache is flushed.

How to Flush DNS Cache in Linux

Depending on your Linux distribution and its DNS service, you’ll need to use different commands to flush the DNS cache.

For Ubuntu and Debian-Based Systems:

  1. Open your terminal.
  2. Use the following command to restart the DNS service: sudo systemd-resolve --flush-caches
  3. Optionally, verify it’s flushed with: sudo systemd-resolve --statistics

For Other Linux Distros:

Restarting the nscd service clears the cache:

sudo service nscd restart

If nscd is not installed, install it using:

sudo apt-get install nscd

How to Flush DNS Cache on Web Browsers

Sometimes, browsers maintain their own DNS cache. Here’s how to clear it:

Google Chrome:

  1. Open a new tab and go to: chrome://net-internals/#dns
  2. Click Clear host cache.
Google Chrome

Mozilla Firefox:

  1. Type about:networking in the address bar and hit Enter.
  2. Navigate to the DNS section.
  3. Click Clear DNS Cache.
Mozilla Firefox

Microsoft Edge:

  1. Type edge://net-internals in the address bar and hit Enter.
  2. Navigate to the DNS section.
  3. Click Clear DNS Cache.
Microsoft Edge

Opera

  1. Type opera://net-internals in the address bar and hit Enter.
  2. Navigate to the DNS section.
  3. Click Clear DNS Cache.

Tips for a Smooth DNS Flushing Process

  • Restart Your Device: After flushing DNS, restarting ensures all changes take effect.
  • Clear Browser Cache: Along with DNS, clear your browser’s cache for a clean start.
  • Update DNS Settings: If you’re still experiencing issues, consider switching to a public DNS like Google (8.8.8.8) or Cloudflare (1.1.1.1).

When to Seek Additional Help

If flushing the DNS cache doesn’t resolve your issue, the problem may lie elsewhere:

  • Router Cache: Restart your router to clear its DNS cache.
  • ISP Issues: Contact your Internet Service Provider if problems persist.
  • Hosting & Domain Issues: Contact Aveshost Support if issues persist.
  • Advanced Configuration: Network settings or firewalls may need adjustment.

Conclusion

The DNS cache, while designed to optimize website loading times, can become a source of connectivity issues due to data corruption or obsolescence.

This article has outlined the procedures for flushing the DNS cache across various operating systems and web browsers. These procedures typically involve utilizing command-line interfaces with administrative privileges or accessing dedicated browser settings.

Regular maintenance of the DNS cache through flushing is recommended to mitigate connectivity problems and enhance security against DNS spoofing.

How to Flush DNS Cache FAQ

Picture of James Wilson

James Wilson

For over 10 years, James has been working in the tech industry. He's an expert in areas like software development, cybersecurity, and cloud computing. He understands the challenges and opportunities that new tech companies face, and he's known for coming up with creative solutions to help them succeed.

Leave a Reply

Get 20% OFF on your first order with us. use promo code: WELCOME

Oh hi there! It’s nice to meet you.

Please Kindly, sign up to receive awesome content in your inbox, every month.

Get 20% OFF on your first order