Flushing the DNS cache removes old or corrupted DNS records from your system. This process ensures you get updated DNS information, helping to resolve connectivity issues such as “website not found” errors and speeding up domain resolution.
Why is Flushing DNS Cache Important?
- Resolves DNS-related issues (e.g., incorrect IP addresses).
- Ensures access to recently updated websites.
- Prevents DNS spoofing attacks.
- Refreshes network configurations after switching DNS servers.
How to Flush DNS Cache on Different Operating Systems
Windows
- Open Command Prompt (Search "cmd" and select Run as Administrator).
- Run the following command:
ipconfig /flushdns
- You should see: "Successfully flushed the DNS Resolver Cache."
macOS
- Open Terminal (Applications → Utilities → Terminal).
- For macOS 10.15 (Catalina) and later, use:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
- Enter your password if prompted, and no output confirms success.
Linux
- Open Terminal.
- If using systemd-resolved, run:
sudo systemctl restart systemd-resolved.service
- For DNSMasq, use:
sudo /etc/init.d/dnsmasq restart
- No success message will be shown by default.
Troubleshooting Tips
- If flushing DNS doesn’t solve the issue, try restarting your router.
- Ensure the DNS servers you’re using are correctly configured.
- For repeated DNS errors, switch to public DNS like Google DNS (8.8.8.8 & 8.8.4.4).