Clearing the DNS cache can help resolve issues like slow internet or incorrect domain resolutions. Below are step-by-step instructions for clearing the DNS cache on various operating systems.
DNS (Domain Name System) cache stores information about domain names and their corresponding IP addresses. Over time, this cache can become outdated or corrupted, leading to issues like slow internet speeds or incorrect domain resolutions. Clearing the DNS cache can help restore proper network functionality.
On macOS Monterey (and newer), you can flush the DNS cache using the following command:
sudo networksetup flushDNS
Note: After clearing the cache, test your internet connection to ensure it resolves correctly.
On Linux, there are multiple ways to clear the DNS cache:
sudo /etc/init.d/nscd restart
Verification: Check if the cache is cleared by running:
sudo nslookup google.com
Look for "Server: 10.100.0.1" to confirm flushing.
sudo systemd-resolve --flush-caches
sudo systemd-resolve --statistics
Look for "Current Cache Size" to confirm flushing.On Windows, you can clear the DNS cache using the ipconfig command:
ipconfig /flushdns