How to Clear the DNS Cache in Windows, MAC and Chrome
Clearing the DNS cache can resolve network connectivity issues and ensure that your computer or browser is accessing the most up-to-date DNS records. The DNS cache stores information about previous DNS lookups, such as IP addresses of websites you have visited, allowing for faster access. However, sometimes the cache can become outdated or corrupted, leading to problems like website loading issues or DNS errors.
This guide will walk you through the steps to clear the DNS cache on Windows, Mac, and Google Chrome.
1. How to Clear DNS Cache in Windows
For Windows 10, 11, 8, and 7
- Open Command Prompt:
- Press Windows + R to open the Run dialog box.
- Type cmd and press Enter to open the Command Prompt.
- Alternatively, you can search for Command Prompt in the Start menu, right-click, and select Run as administrator.
- Run the Flush DNS Command:
- In the Command Prompt window, type the following command and press Enter:ipconfig /flushdns
- In the Command Prompt window, type the following command and press Enter:
- Confirmation Message:
- If successful, you will see a message saying:Successfully flushed the DNS Resolver Cache.
- If successful, you will see a message saying:
For Windows PowerShell (Alternative Method)
You can also use Windows PowerShell to flush the DNS cache:
- Open Windows PowerShell:
- Press Windows + X and select Windows PowerShell (Admin).
- Run the Command:
- Type the following command and press Enter:Clear-DnsClientCache
- Type the following command and press Enter:
- Wait for the process to complete. There may not be a confirmation message, but the DNS cache should be cleared.
2. How to Clear DNS Cache on Mac
For macOS Ventura, Monterey, Big Sur, Catalina, and Earlier Versions
- Open Terminal:
- Go to Applications > Utilities > Terminal.
- Alternatively, press Command + Space, type Terminal, and press Enter to open it.
- Run the Flush DNS Command:
- The command varies slightly depending on the macOS version you are using:
- For macOS Ventura, Monterey, Big Sur, Catalina, Mojave, High Sierra:sudo killall -HUP mDNSResponder
- For macOS Sierra and El Capitan:sudo killall -HUP mDNSResponder
- For macOS Yosemite:sudo discoveryutil udnsflushcaches
- For macOS Mavericks, Mountain Lion, and Lion:sudo killall -HUP mDNSResponder
- Enter Your Password:
- You will be prompted to enter your administrator password.
- Type your password (it will not show up as you type) and press Enter.
- DNS Cache Flushed:
- The DNS cache will be cleared. You won’t see a confirmation message, but the cache will be flushed.
3. How to Clear DNS Cache in Google Chrome
Google Chrome has its own internal DNS cache that is separate from the operating system’s DNS cache. Clearing the Chrome DNS cache can help resolve website access issues specific to Chrome.
Step-by-Step Guide
- Open Google Chrome:
- Make sure you have the browser open.
- Access the Chrome DNS Cache:
- Type the following URL into the address bar and press Enter:chrome://net-internals/#dns
- Type the following URL into the address bar and press Enter:
- Clear Host Cache:
- On the DNS page, click the Clear host cache button. This will clear Chrome’s internal DNS cache.
- Clear Sockets (Optional):
- To ensure that all active connections are reset, go to:chrome://net-internals/#sockets
- Click Flush socket pools.
- To ensure that all active connections are reset, go to:
- Restart Chrome:
- Close and reopen Chrome to ensure that the changes take effect.
Why Clear DNS Cache in Google Chrome?
Clearing Chrome’s DNS cache can help if you experience website loading issues, such as websites not displaying correctly or failing to load, especially after changing DNS settings or moving a website to a new server.
Why Should You Clear the DNS Cache?
- Fix DNS Errors: If you encounter DNS-related errors like “DNS server not responding” or “ERR_NAME_NOT_RESOLVED”, clearing the DNS cache can help resolve them.
- Website Migration: When a website is migrated to a new server or its IP address changes, clearing the DNS cache ensures that you are accessing the updated version of the website.
- Privacy: Clearing the DNS cache removes stored information about websites you’ve visited, offering a bit more privacy.
- Faster DNS Resolution: Clearing the DNS cache can force your system to refresh DNS records, potentially speeding up access to certain websites.
Summary
Clearing the DNS cache can be a quick fix for connectivity and website access issues. Whether you are on Windows, Mac, or just need to clear the DNS cache specifically in Google Chrome, the steps outlined above will help you reset DNS settings and resolve problems related to outdated or corrupted DNS records. Regularly clearing the DNS cache can also ensure that you are always accessing the latest versions of websites, making it a good practice if you frequently work with websites that undergo changes.