How to Flush DNS Cache [Windows, Mac, and Linux]
Last Updated :
27 Mar, 2025
Ever tried to access a website, only to be greeted by a frustrating error message? Or maybe you’ve noticed your internet slowing down for no apparent reason. These issues can often be traced back to your DNS cache, a hidden culprit that stores outdated or incorrect information about websites you’ve visited. The good news? Flushing your DNS cache is a quick and simple fix that can resolve connectivity problems, speed up your browsing, and even enhance your network security.
In this guide, we’ll walk you through how to flush your DNS cache on Windows, Mac, and Linux. Whether you’re a tech novice or a seasoned pro, you’ll find easy-to-follow steps that work in 2025. Ready to banish those pesky errors and get your internet running smoothly again?
Why to Flush DNS Cache
Your computer’s DNS cache stores IP addresses of websites you visit to speed up future connections. But sometimes, this cached data can cause problems instead of helping. Here’s why flushing your DNS cache is useful
1. Fix Website Loading Issues
- If a website’s IP changes but your computer keeps using the old cached address, you might see errors like "This site can’t be reached" or "DNS_PROBE_FINISHED_NXDOMAIN."
- Flushing forces your system to fetch the latest IP, fixing access problems.
2. Resolve Network Troubles After Changes
- Changed your DNS server (e.g., to Google DNS or Cloudflare)?
- Migrated a website to a new host?
- Flushing ensures your system picks up the new settings immediately.
3. Improve Privacy & Security
- Malware or snooping tools can manipulate DNS cache (DNS spoofing).
- Clearing it removes potentially tampered records.
4. Speed Up Browsing (Sometimes)
- If cached DNS entries are corrupted, your browser may take longer to resolve addresses.
- A quick flush can restore normal speed.
5. Troubleshoot Internet Problems
Before resetting your router or reinstalling network drivers, try flushing DNS—it’s a simple first step that often works!
How to Flush DNS Cache in Windows Mac & Linux OS
Now if you are facing any issue which is mentined above, then explore this section to Let's see how to clear the DNS cache for macOS, Windows, and Linux.
1. Flushing the DNS Cache in Windows
Flushing the DNS cache on Windows involves using the Command Prompt. So, explore the below steps for successfull DNS clearing in Windows.
Step 1: Open Command Prompt
- Press Win + R to open the Command Prompt, type cmd, and hit Enter.

Step 2: Use ipconfig
- In the opened Command Prompt window, type in this command and hit Enter:
ipconfig /flushdns

Step Flush DNS Cache
- If successful, you will see a message stating "Successfully flushed the DNS Resolver Cache."

2. Flushing the DNS Cache on Mac
Here's how to flush the DNS cache on your Mac:
- Press the F4 button to open Spotlight.
- A search bar will appear; type "Terminal" and click to open it.

- Enter the following command and press Enter:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
- Type your administrator password when prompted. This is required to run commands with administrative privileges.

- Press Enter again. If successful, you won't see any confirmation message, but your DNS cache will be flushed.
3. Flushing the DNS Cache on Linux
The specific commands for flushing the DNS cache on Linux can vary depending on your distribution. Here are some common methods:
For Ubuntu and Debian
- Open a terminal window. You can usually do this by pressing
- Type the following command and press Enter:
sudo systemd-resolve --flush-caches
For newer versions of Ubuntu
You may need to use this command instead:

sudo resolvectl flush-caches
If successful, you won't see any confirmation message, but your DNS cache will be flushed.

Other Distribution
Here are some examples of other Linux distributions:
sudo service nscd restart
sudo systemd-resolve --flush-caches
Important Note: The above examples are just a few of many possible “sudo systemd-resolve --flush-caches,” and yours might differ. For more accurate instructions, consult your distribution’s documentation.
Once you clear the DNS cache, there may be some slight latency when first visiting web pages. This is because your device has to obtain fresh IP addresses from the DNS server. This delay should be minimal, and subsequent visits to the same website should load at the usual speed.
When Flushing the DNS Cache Might Not Help
This DNS (Domain Name System) cache flushing is not a magic bullet for all internet connectivity problems that affect your computer. Here are some scenarios where it might not be the solution:
- Hardware or software problems: If you frequently get disconnected, have a slow internet overall or specific devices experience issues it could mean your hardware, internet connection or software.
- Website downtime: If the website you are attempting to open is actually down for maintenance or have technical issues then clearing your DNS cache will not just make it appear.
- Incorrect network configuration: Check again if your network settings are set up properly in regard to your ISP (Internet Service Provider).
Related Articles
Similar Reads
How to Flush the DNS Cache in Linux? Are you facing domain resolution issues, or are the websites you're trying to browse not loading fast enough? Well, flushing the DNS cache in Linux can be a fast and effective solution. The DNS cache stores the IP addresses of all the websites you browse and over a period of time, this data becomes
7 min read
How to Clear Cache in Windows 11 Are you noticing that your Windows 11 system is slowing down or taking up too much storage space? One of the most effective ways to speed up your computer and free up space is by clearing the cache. Over time, temporary files, browser cache, and other cached data can build up and cause performance i
6 min read
How to Download and Install CCleaner on Windows? CCleaner is a helpful tool that removes unnecessary stuff from your computer, like browsing history and cookies, to clean unwanted data to make it run better. It can also fix issues in the Windows registry and clear up space on your hard drive. The CCleaner software works with various applications,
3 min read
How to Clear Browser Cache On Windows 10 You must clear your browser cache periodically to ensure that your web browser is not taking excess loading time. However, clearing the browser cache will have a different approach across browsers. Follow these steps to clear your browsing cache in Windows 10 across Google Chrome, Microsoft Edge, an
4 min read
How to Change Default DNS Server from Router and Windows Computer If youâre looking to improve your internet speed, security, or reliability, changing your default DNS server can make a big difference. DNS (Domain Name System) is like the phonebook of the internetâit translates website names into IP addresses so your computer can load them. By switching to a faste
3 min read