How To Flush DNS Cache: An Easy Step-By-Step Guide

Understanding how to flush DNS cache is an important skill for anyone navigating the web. In this step-by-step tutorial, we’ll demystify DNS cache, explain why flushing it is essential, and show you how to do it on various operating systems. So, let’s jump in and ensure your online journey remains smooth!

What Is DNS Cache?

Before we delve into the how, let’s briefly touch on the what. DNS cache, or Domain Name System cache, is like a digital phone book for your internet browsing. It stores previously accessed domain names and their corresponding IP addresses locally on your device. This cache expedites your online experience by avoiding the need to query DNS servers every time you visit a website. In essence, it’s your browser’s way of saving time and making your online journey more efficient.

Did you know that there were 1.88 billion websites online as of 2021, according to Statista? With so many websites to navigate, a well-maintained DNS cache becomes crucial in ensuring a smooth online experience.

Learn more about DNS in our article: What Is DNS? Domain Name System – A Comprehensive Guide.

Why Flush DNS Cache?

Now, you might be wondering, “Why would I need to clear my DNS cache?” Well, here are some compelling reasons:

  1. Resolution Issues: Sometimes, DNS cache can become outdated or corrupted, leading to resolution problems. Flushing the cache ensures you get the most up-to-date information.
  2. Privacy and Security: Clearing your DNS cache can help safeguard your privacy by erasing traces of the websites you’ve visited. It also prevents potential security threats like DNS cache poisoning and spoofing.
  3. Website Updates: When website owners make changes, like migrating to a new domain, your cached DNS information can become outdated. Clearing the cache ensures you access the updated site.
  4. Network Troubleshooting: If you’re experiencing connectivity issues or can’t access a particular site, clearing the DNS cache is often a quick fix.

How to Flush Your DNS Cache

Now, let’s get into the nitty-gritty of clearing DNS cache on different operating systems.

Flushing DNS cache on Windows

Step 1: Open Command Prompt

  • To open the Command Prompt, click on the Windows Start menu and type “cmd” into the search bar.
  • Right-click on “Command Prompt” and select “Run as administrator.”

Step 2: Run the Following Command

In the Command Prompt console, type the following command and hit Enter:

ipconfig /flushdns

Step 3: Voila!

You’ll receive a message confirming the successful flush of your DNS resolver cache. Your DNS cache on Windows is now squeaky clean!

Flushing DNS cache on Mac OS X

Step 1: Access Terminal

  • Open your “Applications” folder.
    Go to “Utilities” and launch “Terminal.”

Step 2: Run the Following Command

In the Terminal, input the following command for your version of Mac and press Enter:

Catalina (10.15), Big Sur (11), Monterey (12) and newer

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

El Capitan (10.11), Sierra (10.12), High Sierra (10.13), Mojave (10.14)

sudo killall -HUP mDNSResponder

Yosemite (10.10)

sudo discoveryutil udnsflushcaches

Lion (10.7), Mountain Lion (10.8), Mavericks (10.9)

sudo killall -HUP mDNSResponder

Snow Leopard (10.6)

sudo dscacheutil -flushcache

Leopard (10.5)

sudo lookupd -flushcache

Tiger (10.4)

lookupd -flushcache

Step 3: Ta-da!

You’ll be prompted to enter your administrative login password, but once that’s done, your DNS cache on Mac OS X is refreshed and ready to go!

Flushing DNS cache on Linux

Linux operating systems may vary, but we’ll provide a general approach.

Step 1: Open Terminal

  • Access your terminal or command line interface. The method can differ depending on your Linux distribution.

Step 2: Reset the DNS Cache

  • Execute the appropriate command for your Linux distribution. For example, on Ubuntu, you can use:
sudo systemd-resolve --flush-caches

Step 3: Problem Solved!

Your DNS cache on Linux is now cleared, and you’re back in action! You can confirm the cache has been cleared using the following command:

sudo systemd-resolve --statistic

FAQ for Flushing DNS Cache

What is DNS cache?

DNS cache is a temporary database that stores information about domains and their corresponding IP addresses. It helps to improve the speed and efficiency of internet browsing by reducing the time required to resolve domain names.

How often should I flush the DNS cache?

There is no set frequency for flushing the DNS cache. It is generally recommended to delete DNS cache when you encounter connectivity issues or if a website’s IP address has changed. You can also choose to delete the DNS cache periodically as part of regular maintenance.

Will removing the DNS cache delete any of my browser’s data or settings?

No, removing the DNS cache will not delete any of your browser’s data or settings. It only clears the locally stored DNS records, which will be automatically refreshed when you access websites or online services.

What is DNS flushing, and how is it different from flushing browser cache?

DNS flushing refers to clearing the locally stored DNS cache on your computer or device. It helps in retrieving fresh DNS information and resolving DNS-related issues. On the other hand, deleting browser cache involves clearing the temporary files, cookies, and other data stored by a web browser. It can help in resolving website display issues or retrieving updated content.

In Conclusion

And there you have it! You’ve successfully learned how to flush DNS cache on different operating systems, ensuring a smoother, safer, and more efficient online experience. Remember, keeping your DNS cache up to date is just one step in optimising your online presence.

At MCloud9, we understand the importance of a seamlessly running website. As a reliable web hosting and domain registration company, we’re here to support your online journey. Whether you’re starting a new online business or looking to enhance your existing web presence, MCloud9 offers a range of services to meet your needs. Our knowledgeable customer support team is just a click away to assist you with any questions or concerns.

Related articles


Please enter your comment!
Please enter your name here