What DNS Caching Actually Does
Every time Windows resolves a domain name like example.com to an IP address, it stores that answer in a local DNS resolver cache so it doesn't have to ask your DNS server again for a while. That's normally a good thing — it makes browsing faster. But if a site changes its IP address, if you switched networks or VPNs, or if malware or a misconfigured router poisoned an entry, that cached record goes stale and Windows keeps handing your browser a wrong or dead address, producing errors like "This site can't be reached" or "DNS_PROBE_FINISHED_NXDOMAIN" even though the site is actually fine.
ipconfig /flushdns wipes that local cache clean, forcing Windows to look up every domain fresh the next time you visit it.
Step 1: Open an Elevated Command Prompt
- Press Win, type cmd.
- Right-click Command Prompt and choose Run as administrator (flushing DNS doesn't strictly require elevation on most systems, but running as admin avoids permission errors on locked-down machines).
Step 2: Flush the Cache
ipconfig /flushdns
You should see:
Windows IP Configuration
Successfully flushed the DNS Resolver Cache.
Step 3: Go Further If the Problem Persists
Flushing DNS alone fixes most stale-cache issues, but connectivity problems are often layered. Run these in order if the flush alone doesn't help:
Release and Renew Your IP Address
ipconfig /release
ipconfig /renew
This drops your current DHCP lease and requests a fresh one from your router, which also clears out any bad gateway or subnet configuration your adapter picked up.
Re-register With Your DNS Server
ipconfig /registerdns
Mainly relevant on domain-joined machines — it re-registers your hostname with your DNS server, useful if internal name resolution (e.g. reaching other PCs by hostname on an office network) has broken.
Reset Winsock (for deeper corruption)
netsh winsock reset
netsh int ip reset
netsh commands above only take effect after a reboot, and netsh int ip reset can reset your network adapters to default settings, wiping custom static IPs or manual DNS entries. Note those down first if you've customized them.
Step 4: Verify It Worked
Check that a domain now resolves correctly with nslookup:
nslookup example.com
If it returns a valid IP address without a timeout, resolution is working. You can also confirm the cache is actually clean by trying to display it:
ipconfig /displaydns
Immediately after a flush, this should return a mostly empty list (or repopulate quickly as you browse).
When to Suspect Something Other Than DNS Cache
- Every site fails, including by IP address: that's not a DNS problem — check your physical connection, Wi-Fi signal, or router.
- Only specific sites fail consistently: could be the site itself, a firewall/antivirus block, or your ISP throttling/blocking that domain — flushing DNS won't help here.
- Problem returns within minutes: your router or ISP's upstream DNS server may itself be serving bad records. Switching your adapter to a public resolver like
8.8.8.8or1.1.1.1sidesteps a broken ISP DNS server entirely.
Quick Reference
ipconfig /flushdns REM clear the local DNS cache
ipconfig /displaydns REM view current cache entries
ipconfig /release REM drop current DHCP lease
ipconfig /renew REM request a new DHCP lease
ipconfig /registerdns REM re-register hostname with DNS
netsh winsock reset REM reset Winsock catalog (needs reboot)
Discussion & Insights