Flushing the DNS cache is a crucial step in troubleshooting and maintaining optimal internet connectivity. The DNS cache stores information about previous DNS lookups, which can sometimes become outdated or corrupted, leading to issues accessing websites. Whether you are using Windows, Mac, or Linux, knowing how to flush the DNS cache can help ensure your system is using the most current DNS information.
This guide will provide you with step-by-step instructions on how to flush the DNS cache on all three operating systems, helping you resolve connectivity issues and maintain a smooth browsing experience.
What are the Signs You Should Flush Your DNS Cache?
Although the DNS cache is generally good, sometimes it may be worthwhile to flush the DNS cache to fix browsing issues. Some of the indicators of such situations are as follows:
- Websites fail to fully load: In case you encounter error messages like “This site can’t be reached” or see a website that looks outdated despite being updated elsewhere, this is an indication that your DNS cache may have been corrupted.
- Your internet service provider has changed: If you just recently switched ISPs and your DNS cache still references the old DNS servers. Clearing the cache will ensure that you are using the new servers which are accurate.
- You believe you’ve stumbled upon a phishing site: Phishing websites normally copy real sites. Deleting all cookies as well as clearing any other traces of these mentioned above will help in preventing users from getting redirected towards harmful duplicates and thereby remaining safe forever. But remember, when it comes to web things one can never be too cautious.
How to Flush DNS Cache?
However, clearing your DNS cache is simple but will differ depending on your operating system (OS) and whether you are doing it from your computer or browser. In the following sections, we shall detail how to clear the DNS cache for macOS, Windows, and Linux.
1. Flushing the DNS Cache on Windows
Flushing the DNS cache on Windows involves using the Command Prompt:
- Press Win + R to open the Command Prompt, type cmd, and hit Enter.
In the opened Command Prompt window, type in this command and hit Enter:
ipconfig /flushdnsIf 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 mDNSResponderType 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-cachesFor newer versions of Ubuntu
You may need to use this command instead:
sudo resolvectl flush-cachesIf 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:
- Fedora/CentOS
sudo service nscd restartArch Linux
sudo systemd-resolve --flush-cachesImportant 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).
Conclusion
Regularly flushing the DNS cache can prevent and resolve many common internet connectivity issues across different operating systems. By following the steps outlined in this guide, you can ensure that your Windows, Mac, or Linux system is using the latest DNS information, leading to a more stable and efficient browsing experience. Keep this guide handy to quickly address any DNS-related issues that may arise in the future.
How to Flush DNS Cache? [Windows, Mac, and Linux] – FAQs
What is the DNS cache, and why should I flush it?
The DNS cache stores translations of website names, such as [www.example.com], into numbers called IP addresses on your computer. This cache speeds up browsing by readily providing IP addresses for websites you’ve visited before. However, outdated entries in the cache can lead to website loading issues. Flushing the cache clears out this data, forcing your device to obtain fresh IP addresses, potentially resolving website connectivity problems.
How often should I flush my DNS cache?
Flushing of DNS Cache depends on how often one wants to accomplish this task while using their computers or any other devices. For instance, if your device cannot open some websites, has slow browsing speeds, or is suspicion about a phishing site then cleaning the DNS cache can be helpful.
Will flushing the DNS cache erase my browsing history?
No, only the temporary database of web address translations is cleared when flushing the DNS cache. Your browsing record will not be affected at all since cookies and other browsing activities are stored in different sections of your browser. Blockquote
Is flushing the DNS cache safe?
Yes, flushing the DNS cache is a safe and common troubleshooting technique. It simply clears out temporary data and doesn’t affect your device or personal information.
How do I flush the DNS cache on Windows?
To flush the DNS cache on Windows, open Command Prompt as an administrator and enter the command `
ipconfig /flushdns`.
How do I flush the DNS cache on a MacOS?
Open Terminal and enter the command `
sudo killall -HUP mDNSResponder`for macOS Mojave and later, or `sudo dscacheutil -flushcache`for earlier versions.
How do I flush the DNS cache on Linux?
Open Terminal and enter the command `
sudo systemd-resolve --flush-caches`for systems using systemd, or `sudo /etc/init.d/dns-clean restart`for others.
More Tips & Tricks
Linux
- NEW Compress or Extract Files in Terminal
- 25 Basic Linux Commands For Beginners
- How to use 'APT'
- Change Login Background (Mint 22)
- Free Linux Manuals
- Linux Commands from A-Z: free downloadable PDF
- Linux Distros & where to get them
- How to Install Linux Mint
- Dual Booting Windows & Linux
Raspberry Pi
- NEW Raspberry Pi NAS
- Dual Boot the Pi
- NVMe SDD on a Pi
- Clone your Pi SD Card
Free Ebooks
- Crochet
- Knitting
- Loom Knitting
- Cross Stitch
- Windows Manuals
- Linux Manuals
- Raspberry Pi
- Lua
- HTML, CSS & JS
Handy Tools

Learning Linux


Watch the Series.

Watch the Series.
It's FOSS RSS
- This Bachelor's Thesis lets You Build Your Own Kindle Alternative eBook Reader
- New Arch Installer Update Adds U2F Authentication and Bluetooth Support
- wget Removed from Ubuntu Server 25.10 Default Install (And No, It's Not Because of Rust)
- NordVPN Takes on Phone Scammers with Scam Call Protection Feature
- Arch Linux Users at Risk Again as AUR Hit by Another RAT
- Say Goodbye to Microsoft Authenticator! Proton Just Introduced a Solid Alternative
- CISCO Giften AGNTCY Project to Linux Foundation to Standardize AI Agent Communication
- Hands-On with Onlook: The AI-Powered Visual Editor That Blends Code and Design
- Best Linux Laptop of 2025? TUXEDO InfinityBook Pro 15 (Gen10) Launches
- Latest Linux Kernel 6.16 is all Focused on AMD, Intel, and NVIDIA
- How Does OpenMandriva Lx 'Rock' Stack Against Fedora? My Thoughts
- Mastodon Wants Funding and Won't Mind Nudging You for Donation
- Irony? AI-focused Open Source Code Editor Zed Lets You Disable All AI Features
- I Tried Proton's Lumo AI, a Private Alternative to ChatGPT
- Someone Slipped a RAT into Arch Linux!