This article explains the steps to clear the DNS cache on your computer.
Clearing the DNS cache on your computer is an essential task to troubleshoot and resolve internet connectivity issues. The DNS cache stores the IP addresses of the websites you visit, so clearing the cache can help resolve errors and speed up the loading of websites. In this article, we’ll show you how to clear the DNS cache on Windows, macOS, and Linux systems.
Clearing DNS Cache on Windows
There are two methods to clear the DNS cache on a Windows computer: using the Command Prompt or using the Windows Power Shell.
Method 1: Using the Command Prompt
- Press the Windows key + X and select Command Prompt (Admin) from the menu.
- Type the following command in the Command Prompt window and press Enter: ipconfig /flushdns
- You should see the following message: “Successfully flushed the DNS Resolver Cache.”
Method 2: Using the Windows Power Shell
- Press the Windows key + X and select Windows Power Shell (Admin) from the menu.
- Type the following command in the Windows Power Shell window and press Enter: Clear-DnsClientCache
- You should see the following message: “DNS client cache cleared.”
Clearing DNS Cache on macOS
Clearing the DNS cache on a macOS computer can be done using the Terminal.
- Open Terminal (press Command + Space, type Terminal, and press Enter).
- Type the following command in the Terminal window and press Enter: sudo dscacheutil -flushcache
- Enter your administrator password when prompted.
- You should see the following message: “Cache flushed.”
Clearing DNS Cache on Linux
The process to clear the DNS cache on Linux systems varies depending on the distribution you’re using. Here are some of the most common methods:
Method 1: Using the Terminal
- Open Terminal.
- Type the following command in the Terminal window and press Enter: sudo /etc/init.d/nscd restart
Method 2: Using the systemd
- Open Terminal.
- Type the following command in the Terminal window and press Enter: sudo systemctl restart NetworkManager
Google Chrome browser
The Google Chrome browser keeps a DNS cache of its own. To clean it, follow these instructions:
- Open Google Chrome.
- In the address bar, enter chrome://net-internals/#dns. This will display a list of hosts in Google Chrome’s internal DNS cache.
- Click “Clear host cache.”
- In the address bar, enter chrome://net-internals/#sockets.
- Click “Close idle sockets” and then “Flush socket pools.”
Conclusion
Clearing the DNS cache on your computer is a quick and simple process that can help resolve internet connectivity issues. Whether you’re using Windows, macOS, or Linux, the steps to clear the cache are straightforward. If you experience any issues with your internet connection, clearing the DNS cache is a good place to start troubleshooting.