Your internet speed and website access depend on a hidden hero—DNS caching. But when it goes wrong, you get errors like “This site can’t be reached” or slow loading.
This easy-to-follow guide explains:
✅ What DNS cache is (and why it matters)
✅ When & why to flush it
✅ Step-by-step flushing instructions (Windows, Mac, Linux, Android, iOS)
✅ Pro tips to optimize DNS performance
Let’s fix your connection issues fast!
What Is DNS Cache?
DNS (Domain Name System) cache is like your phone’s contact list for the internet. It stores:
- Website names (e.g., google.com)
- Their IP addresses (e.g., 142.250.190.46)
Instead of asking a DNS server every time, your device remembers these pairs for faster access.
Why Flush DNS Cache? 5 Key Reasons
1️⃣ Fix “This site can’t be reached” errors
2️⃣ Resolve outdated IP addresses (after website moves)
3️⃣ Stop DNS spoofing/hijacking attacks
4️⃣ Speed up slow internet connections
5️⃣ Troubleshoot VPN/proxy issues
Pro Tip: Flushing is harmless—your system will rebuild the cache automatically.
How to Flush DNS Cache (All Devices)
Windows 10/11
- Press Win + R, type
cmd
, then press Ctrl+Shift+Enter (Admin)
- Run these commands one by one:
bash
ipconfig /flushdns
ipconfig /registerdns
ipconfig /release
ipconfig /renew
netsh winsock reset
- Restart your PC
For PowerShell users: Clear-DnsClientCache
macOS (Ventura & Later)
- Open Terminal (Finder > Applications > Utilities)
- Choose your macOS version:
- macOS 12-14+:
bash
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
- Older versions:
bash
sudo discoveryutil mdnsflushcache
Enter your admin password when prompted
Linux (Ubuntu/Debian)
- Open Terminal (Ctrl+Alt+T)
- Run the correct command for your service:
- systemd-resolved:
bash
sudo systemd-resolve --flush-caches
- NSCD:
bash
sudo /etc/init.d/nscd restart
Android
No direct flush option—try these workarounds:
- Toggle Airplane Mode on/off
- Forget Wi-Fi Network > Reconnect
- Use 1.1.1.1 (Cloudflare DNS) in:
Settings > Network > Private DNS > dns.google
iOS (iPhone/iPad)
- Turn Airplane Mode on/off
- Reset Network Settings:
Settings > General > Transfer or Reset > Reset > Reset Network Settings
When Should You Flush DNS?
✔ After changing hosts/IPs (e.g., migrating a website)
✔ When websites won’t load but work on other devices
✔ If you suspect DNS poisoning (fake sites appearing)
✔ Before running internet speed tests
3 Advanced DNS Optimization Tips
1. Switch to Faster DNS Servers
Replace your ISP’s slow DNS with:
- Cloudflare:
1.1.1.1
and1.0.0.1
- Google:
8.8.8.8
and8.8.4.4
How to change:
- Windows:
Control Panel > Network > IPv4 Properties
- Mac:
System Preferences > Network > Advanced > DNS
2. Disable IPv6 (If Having Issues)
Some networks handle IPv6 poorly:
- Open Network Connections
- Right-click your adapter > Properties
- Uncheck “Internet Protocol Version 6 (TCP/IPv6)”
3. Clear Browser-Specific DNS
Chrome/Firefox cache DNS separately:
- Chrome: chrome://net-internals/#dns > “Clear host cache”
- Firefox: about:networking#dns > “Clear DNS Cache”
FAQ: DNS Cache Explained
Q1: How often does DNS cache clear itself?
A: Typically every 24-48 hours, but some entries last weeks.
Q2: Can flushing DNS speed up my internet?
A: Yes, if you’ve been using outdated IP addresses.
Q3: Is public DNS (like Google’s) safer than my ISP’s?
A: Often yes—Cloudflare/Google DNS encrypt queries better than many ISPs.
Q4: Why do I still get errors after flushing?
A: Try:
- Restarting your router/modem
- Checking for malware (some viruses alter DNS)
Q5: Does VPN affect DNS cache?
A: Yes! Always flush after switching VPN servers/locations.
Final Thoughts
Flushing DNS cache is a quick fix for many connectivity issues. Bookmark this guide for future troubleshooting!