Key Takeaways
- On Windows, open the Command Prompt and run ipconfig /flushdns to clear the DNS cache.
- On Mac, open Terminal and enter the appropriate flush command based on your macOS version.
- On Linux, open Terminal and restart the DNS service used by your distribution to flush the cache.
- In Chrome, navigate to chrome://net-internals/#dns and click “Clear host cache” to remove DNS entries.
- Flushing DNS helps fix connectivity issues, update outdated records, prevent DNS spoofing, resolve 404 errors, protect privacy, and improve system security.
Wondering how to flush DNS and, more importantly, when you should do it? Flushing DNS is the process of clearing your device’s cache and resolver records to ensure that all DNS entries are up-to-date and accurate. This helps improve network performance, boosts stability, and ensures that domain names correctly resolve to their current IP addresses.
In this guide, you’ll learn how to flush DNS across various platforms, including Windows, Mac, Linux, and even web browsers like Google Chrome.
What is a DNS cache?
A DNS cache is a temporary database stored locally on your device that keeps a record of recent DNS (Domain Name System) lookups. These records include information such as domain names, corresponding IP addresses, and other DNS-related data that help your system locate websites more quickly.
When you visit a website, your computer performs a process called DNS resolution, which translates the domain name into an IP address that your browser can connect to. Instead of repeating this lookup every time, your system saves the result in its DNS cache to speed up future visits.
The cache also includes a feature called Time-To-Live (TTL), which determines how long a record is stored before it expires. During the TTL period, your system pulls the DNS data from the cache rather than contacting a DNS server again. Once the TTL runs out, the entry is cleared, and your system performs a fresh lookup.
This caching process happens automatically and helps improve performance. However, if the data becomes outdated, due to changes in a site’s IP address or DNS settings, you might run into issues like sites not loading or showing incorrect pages. In such cases, knowing how to flush DNS can be an effective way to clear the old data and restore proper functionality.
Simplify Security with PowerDMARC!
How To Flush DNS: For Windows
The steps below will walk you through how to clear your computer’s DNS cache in the latest and previous versions of Windows:
1. Click the Windows icon or Start button in the bottom left corner of your screen.
2. Click on or Search for Command Prompt.
3. Another way to open the command prompt console is by pressing Windows+R to bring up the RUN menu and enter cmd.
4. If you see a popup window asking if you want to allow Command Prompt to make changes on your computer, select Yes.
5. If you are asked for administrative login credentials at this point, please contact your system administrator.
6. Type ipconfig /flushdns in the command prompt window.
7. Press Enter.
8. You should see a message confirming that the DNS resolver cache has been flushed.
Note: The steps for flushing your DNS cache on Windows XP and Vista are nearly identical to those used in the latest Microsoft versions. However, the message at the end may differ or require admin privileges to proceed.
How To Flush DNS: For Mac Users
Flushing your DNS cache on a Mac is easy, but you will need to know what version of OS X you’re using so that you can use the correct command. Some problems with the new macOS can arise if you’re not familiar with these commands and their compatibility.
Follow these step-by-step instructions to learn how to flush DNS on a Mac:
- Open Finder.
- Click on Applications.
- Navigate to the Utilities folder.
- Open Terminal. (Alternatively, you can find the Terminal app by searching for it in Launchpad.)
- In the Terminal window, type the command that corresponds to your macOS version:
macOS version | Command |
---|---|
macOS 14 (Sonoma) macOS 13 (Ventura) macOS 12 (Monterey) macOS 11 (Big Sur) macOS 10.15 (Catalina) macOS 15 (Sequoia) (beta or latest) | sudo killall -HUP mDNSResponder |
macOS 10.10 (Yosemite) | sudo discoveryutil -mdnsflushcache |
macOS 10.7 – 10.9, 10.11 – 10.14 (Lion through Mojave, excluding Yosemite) | sudo killall -HUP mDNSResponder |
macOS 10.5 – 10.6 (Leopard, Snow Leopard) | sudo dscacheutil -flushcache |
macOS 10.4 (Tiger) | lookupd -flushcache |
- Press Enter.
- When prompted, type your admin password, then press Enter again.
- You should see a confirmation or no message at all—either way, your Mac has successfully flushed the DNS cache.
- Should I flush DNS manually?
DNS cache is a way of storing the information that’s relevant to finding a website. This can include IP address, hostname, and other DNS records. Your network’s DNS server keeps track of all of these records and makes sure they’re updated when they need to be.
A DNS cache periodically clears its own memory, without you having to do anything. Apart from storing all the information needed to locate a website, it also contains information about the Time-To-Live or TTL.
The TTL is how long an entry will stay in the DNS cache before it expires. So within this period, any answers to queries are retrieved from the local domain cache without resorting to asking a DNS server. When the TTL expires, a record of it will vanish from the cache.
For example, if the TTL for a website is set at three minutes, then the first request made after the TTL expiration will retrieve fresh information through the DNS server first instead of going through the local cache.
So should you flush DNS manually or not is your own decision, especially if you are a power user. For instance, if you’re experiencing a problem with your internet connection, you might want to consider flushing your DNS cache. This will make sure that any outdated information about websites is deleted and replaced with new data from the authoritative servers.
How to Flush DNS on Linux
While Windows and Mac OS X computers have DNS caches built in, Linux doesn’t. However, each distribution of Linux might use a different DNS service for its DNS record storage. You may need to restart the service for these changes to take effect.
Here’s how to do it:
1. Open a terminal window by pressing Ctrl+Alt+T.
2. In the Terminal window, type in one of these commands based on what version of Linux you’re using.
- NCSD: sudo /etc/init.d/nscd restart
- Dnsmasq: sudo /etc/init.d/dnsmasq restart
- BIND: You may have to try multiple commands:
○ sudo /etc/init.d/named restart
○ sudo rndc restart
○ sudo rndc exec
3. You may be prompted to enter your password.
4. The service will stop and then restart before successfully flushing the cache.
How to Flush DNS in Browsers
Sometimes, even after flushing your system’s DNS cache, you may still experience issues like slow loading, outdated pages, or sites not opening correctly. That’s because many modern web browsers, especially those based on Chromium, maintain their own internal DNS cache to speed up browsing and reduce lookup times.
Flushing your browser’s DNS cache can help resolve issues caused by stale or incorrect DNS entries, especially after recent website migrations, server changes, or DNS updates.
Here’s how to flush DNS in popular browsers:
Google Chrome
Since Chrome uses its own DNS cache, clearing it can fix page-loading errors and other performance issues.
Steps:
- Open Google Chrome.
- In the address bar, type: chrome://net-internals/#dns
- Press Enter.
- Click the “Clear host cache” button.
Mozilla Firefox
Firefox also allows users to manually flush DNS through its internal networking tools.
Steps:
- Open Firefox.
- In the address bar, type: about:networking#dns
- Press Enter.
- Under the DNS section, click “Clear DNS Cache.”
Microsoft Edge
Since Edge is built on Chromium, the process is exactly the same as in Chrome.
Steps:
- Open Microsoft Edge.
- Type the following in the address bar: edge://net-internals/#dns
- Press Enter.
- Click the “Clear host cache” button.
Brave Browser
Brave, being Chromium-based as well, follows the same process.
Steps:
- Open Brave.
- In the address bar, enter: brave://net-internals/#dns
- Hit Enter.
- Click on “Clear host cache.”
Benefits of Flushing DNS
Flushing DNS is a good way to clear out any cached information that might be causing issues with your network. It’s especially useful if you’re having problems accessing websites or other online services, as it can help get things back on track.
Flushing DNS may also improve performance by updating the server’s cache and preventing it from sending out incorrect responses based on outdated information.
Here are some more reasons why you might want to flush your DNS:
1. To Prevent DNS Spoofing
DNS spoofing or DNS cache poisoning is when an attacker gains access to your DNS cache, tempers with it such that certain domain names resolve incorrectly, and reroutes your DNS requests to their own website for fraudulent purposes such as such as DNS hijacking, phishing, man-in-the-middle attacks, malware distribution, and the like.
This can be prevented by flushing your DNS cache because when you flush your DNS cache, it forces the system to use a new cached version of the DNS record instead. By doing so, you prevent any rogue entries from being included in your system’s cache that might have been added by an attacker.
2. To Fix 404 Errors
If a website moves to a new domain or server, the DNS information stored on your computer may not be updated. You could end up seeing a 404 error when you try to visit that site—and need to flush (or clear) your DNS cache for the real address of that page to pop back into view.
3. Fix Website Not Loading Issues
The need for DNS flushing arises when a website is not loading correctly. This could be a result of an issue with the IP address or it could be because of the changes in the DNS server settings. In such situations, a DNS flush forces your browser to reload the DNS resolver, which will force it to look for the IP address of the website again.
4. Hide Your Browsing History
When you visit a website, your computer makes an entry in its cache that indicates how many times you visited that site. This way, if a data collector or hacker gets hold of your DNS cache, they can use this information to determine which websites you visit and when.
A DNS flush will erase the cache and make it impossible for anyone else to access this information. This will prevent your browsing history from being exposed, which can help protect you against hackers and data collectors trying to prevent spyware or track your online behavior.
.
5. Improve Your Security
While you can use a DNS flush to protect yourself from data collectors and hackers, it can also help to improve the security of your computer system. This is because deleting all of the information in your cache will force your computer to re-download websites as needed, which means that any malicious code embedded within them will not be executed automatically.
Additionally, the advancement of AI in cybersecurity is increasingly helping to identify and block threats, making it even more important to maintain clean and secure DNS caches.
Conclusion
Most web servers use DNS cache to store lookups of IP addresses. The purpose of this technology is to save time by not making repeated lookups in the Internet Protocol (IP) address system. In turn, this increases the speed at which the site responds to users; however, this can also lead to problems.
For example, if an IP address changes and no refreshes are made to the DNS cache then site visitors will still be directed to the old IP address, via cached results that remain on the system.
Also, your data can be exposed to external entities if the DNS cache is not properly managed.
Therefore, flushing the DNS is an important security step to take. It will ensure that you have the most up-to-date information in your DNS records, while also eliminating any outdated cached information. This can help reduce the risk of exposing sensitive data or being directed to an incorrect IP address.
Frequently Asked Questions
Can flushing DNS improve internet speed?
Yes, it can—especially if you’re experiencing slow-loading websites due to outdated or corrupted DNS records. By flushing the DNS cache, your system is forced to fetch the latest IP addresses directly from the DNS server.
Will flushing DNS fix DNS_PROBE_FINISHED_NXDOMAIN errors?
Yes, in some cases. This error typically appears when your browser can’t resolve a domain name. If the issue is caused by a bad or outdated DNS cache entry, flushing your DNS can clear the incorrect data and allow your system to retrieve the correct information from the DNS server.
Do I need to flush DNS after changing routers?
It’s a good idea. When you switch routers—especially if your new one uses different DNS settings—your system might still rely on cached entries from the previous connection. Flushing the DNS ensures that your device discards old records and queries the new DNS server fresh.
Is it safe to flush DNS often?
Yes, flushing your DNS is completely safe and doesn’t affect your system’s performance negatively. In fact, doing it periodically can help prevent connection problems, eliminate outdated records, and reduce the chances of DNS spoofing.
Related Articles
- How to Flush DNS on Windows, Mac, Linux & Browsers - July 11, 2025
- Vendor Email Compromise (VEC): How to Stop Attacks from Trusted Vendors - July 3, 2025
- Marketing Emails Not Reaching Customer Inboxes - July 2, 2025