How to clear DNS cache on Windows 10, macOS and Linux?
An Internet connection problem? Are web pages taking longer and longer to load? It might be time for you to clear your PC’s DNS cache.
Yes, you should know that each time you venture onto the Internet, your computer automatically keeps in memory the IP addresses and the domain names visited in cache memory. This caching helps speed up page load times for your next Web visits.
However, it sometimes happens that the DNS records of a website change and this causes you to generate 404 error pages. It is therefore necessary in these cases to flush DNS cache from your computer. Once the DNS cache has been cleaned, your computer will query the domain name servers again to collect the new DNS information.
In addition, you may also experience connection issues due to a crash of your ISP’s DNS servers. In this case, it is not necessary to empty the DNS cache but rather to change them. To do this, I invite you to read my article which will help you to change your computer’s DNS servers.
Come on, let’s get back to our sheep and find out without further ado how clean the DNS cache on Windows 10, macOS and Linux.
Reset DNS cache on Windows
1. Simultaneously press the keys Windows + X on your keyboard, then click Command prompt (admin) Or on Windows PowerShell (admin).
2. Once the command prompt opens, type the following command, then validate with Entrance.
3. The following message should then appear: Windows IP Configuration. DNS resolver cache flushed.
4. Now you go check if the DNS cache has been cleared, type the following command and press Entrance :
Enable or disable DNS cache
If for some reason you want disable DNS caching, you just need to type the following command and press Entrance.
net stop dnscache
And if you wish enable DNS caching, you just need to type the following command and press Entrance.
net start dnscache
Clean the DNS cache on macOS (10.10.4 or higher)
1. Go to the menu Go, then Utilities.
2. Then click on Terminal.
3. Once the terminal is open, type the following command, and press the key Entrance on your keyboard to validate:
sudo killall -HUP mDNSResponder
Clear DNS cache on Linux
1. Open the terminal and type the following command to restart nscd:
sudo /etc/init.d/nscd restart
That’s all !