ipconfig /flushdns
Clear out old DNS records to fix network issues and get fresh results.
ipconfig /flushdns
Command: ipconfig /flushdns
Category: Network
Type: CMD
Purpose
Clears and resets the DNS (Domain Name System) resolver cache on your computer. This removes all stored DNS entries, forcing Windows to query DNS servers again for fresh results. Essential for resolving DNS-related connectivity issues.
Quick Summary
One command clears all cached DNS records, fixing issues where websites won't load or point to wrong IP addresses. When DNS cache holds outdated or incorrect information, flushing it forces fresh lookups. Perfect for fixing "website not found" errors after DNS changes or network issues.
How to Use
- Open Command Prompt (no administrator rights required on most Windows versions).
- Type
ipconfig /flushdnsand press Enter. - You should see: "Successfully flushed the DNS Resolver Cache."
Alternative:
- On some systems, may require Command Prompt as Administrator
Tips and Best Practices
- Flush DNS when websites suddenly stop loading but internet works.
- Use after changing DNS servers to ensure old records are cleared.
- Flush DNS after hosts file modifications to see changes immediately.
- Combine with browser cache clearing for complete troubleshooting.
- Safe to use anytime—won't cause any harm to your system.
- May briefly slow down first website access as cache rebuilds.
Common Use Cases
- Website won't load: Site doesn't load but others do; cached DNS may be stale or incorrect.
- After DNS server changes: Clear cache after switching to different DNS servers (Google DNS, Cloudflare, etc.).
- Hosts file edits: Immediately apply changes made to the Windows hosts file.
- Network troubleshooting: Part of standard troubleshooting for connectivity issues.
- VPN issues: Clear DNS cache after VPN connects to use VPN's DNS servers.
- Website moved: After a website changes IP addresses, flush to get the new address.
- Development/testing: Web developers clearing cache for testing DNS changes.
Prerequisites
- Windows Command Prompt or PowerShell
- Usually no administrator rights required (depends on Windows version)
- If permission denied, run Command Prompt as Administrator
- Available on all Windows versions
What Gets Cleared
The DNS cache stores:
- Successful lookups: Domain names and their IP addresses
- Failed lookups: Negative cache entries (non-existent domains)
- TTL data: Time-to-live information for each entry
After flushing, all this information is removed, and future lookups will query DNS servers again.
Related DNS Commands
View DNS cache before flushing:
ipconfig /displaydns
View all DNS settings:
ipconfig /all
Register DNS name and refresh DHCP:
ipconfig /registerdns
Release and renew IP (also clears DNS cache):
ipconfig /release
ipconfig /renew
Troubleshooting
- "Access denied" - Run Command Prompt as Administrator.
- "The requested operation requires elevation" - Right-click Command Prompt and select "Run as administrator."
- Command not recognized - Ensure you're in Command Prompt or PowerShell (not Run dialog).
- Still can't access site after flush - Problem may not be DNS; check with
nslookup domain.comorping domain.com - No change after flushing - Clear browser cache too; browsers have their own DNS cache.
Complete DNS Troubleshooting Sequence
When experiencing DNS issues:
- Flush DNS cache:
ipconfig /flushdns - Check DNS resolution:
nslookup problematic-website.com - Verify DNS servers:
ipconfig /all(look for DNS Servers line) - Try alternate DNS: Temporarily switch to Google DNS (8.8.8.8) or Cloudflare (1.1.1.1)
- Clear browser cache: Clear browser's cache and cookies
- Restart DNS Client service:
net stop dnscache && net start dnscache(as Admin)
When DNS Flushing Won't Help
Flushing DNS won't fix:
- No internet connection - Physical or router connectivity issues
- Firewall blocking - Firewall or antivirus blocking connections
- Wrong DNS servers - DNS servers configured incorrectly
- ISP DNS issues - DNS server problems at your ISP
- Website is actually down - Site is offline for everyone
Browser-Specific DNS Cache
Modern browsers maintain their own DNS cache. To fully clear DNS:
Chrome:
chrome://net-internals/#dns
Click "Clear host cache"
Firefox:
- Type
about:networking#dnsin address bar - Click "Clear DNS Cache"
Edge:
edge://net-internals/#dns
Click "Clear host cache"
Advanced: DNS Client Service
Check DNS Client service status:
sc query dnscache
Restart DNS Client service (as Administrator):
net stop dnscache
net start dnscache
Viewing DNS Cache Contents
Before flushing, you can view cached entries:
ipconfig /displaydns
This shows:
- Domain names that have been resolved
- Their corresponding IP addresses
- TTL (time-to-live) remaining for each entry
- Whether entry is from hosts file or DNS server
Output can be very long; consider redirecting to a file:
ipconfig /displaydns > dns-cache.txt
Related Tools
nslookup- Query DNS servers directly to test resolutionping- Test connectivity and DNS resolution togethertracert- Trace route to destination (includes DNS lookup)pathping- Combination tool with DNS resolutionnetsh interface ip show dnsservers- Display configured DNS servers