Fix Connectivity: How to Flush DNS Cache on Windows & More
Master how to flush DNS cache on Windows; the `ipconfig /flushdns` command clears it, helping you resolve network errors and verify your fix confidently.

How to Flush DNS Cache on Windows: Regain Network Control
A Domain Name System (DNS) resolver cache stores recently resolved domain names and their corresponding IP addresses locally. This local storage speeds up future website visits. Sometimes, however, this cache becomes corrupted or outdated, causing frustrating network issues.
Knowing how to flush dns cache on windows is a critical skill for anyone troubleshooting network problems. This simple action can often resolve connectivity issues, fix "page not found" errors, and ensure you connect to the most current version of a website. We'll walk through the process, explain why it matters, and show you how to verify your fix. You gain back control over your network experience.
Why Your Internet Feels Broken
Your computer keeps a local record of website addresses it has recently visited. This is your DNS Cache, also known as the DNS Resolver Cache. It works like a phone book for the internet, translating human-readable domain names (like google.com) into machine-readable IP Addresses (like 172.217.160.142). This caching makes browsing faster, cutting down the need for repeated queries to external DNS servers.
But what happens when that phone book has old or wrong numbers? Corrupted DNS cache entries lead to headaches. You might see "page not found" errors, get redirected to the wrong sites, or experience slow loading times even with a strong internet connection. It feels broken. Sometimes, a website updates its IP Address, but your local cache still holds the old one. So you can't reach the new site. Flushing DNS becomes a key troubleshooting step for these network-related issues or outdated IP information.
The Dangers of a Stale Cache
Beyond mere inconvenience, a compromised DNS cache can pose security risks. Imagine your system directs you to a malicious site, thinking it's your bank. This happens when the cache holds incorrect entries, often due to malware or DNS poisoning. If you're not careful here, the entire setup becomes a liability. Attackers exploit vulnerabilities to inject false records, making you connect to their servers.
And then there's privacy. Your DNS cache holds a history of your web activity. While flushing won't erase all traces online, it clears this local record. Organizations like the Electronic Frontier Foundation advocate for regular cache management as part of broader digital hygiene. So, a flush isn't just about fixing; it's about maintaining a clean, secure digital environment.
Flush DNS on Windows
Clearing your Windows DNS cache is a straightforward process, primarily using the Command Prompt. This utility, ipconfig, allows you to display and configure network settings. It’s a powerful tool, but you'll use just a few simple commands.
Step-by-Step Guide for Windows 10/11
- Open Command Prompt as Administrator:
- Click the Start button or press the Windows key.
- Type
cmdinto the search bar. - Right-click on Command Prompt in the search results.
- Select Run as administrator. You'll likely see a User Account Control prompt asking for permission; click Yes.
- Execute the Flush Command:
- In the Command Prompt window, type the following command exactly as shown:
ipconfig /flushdns - Press Enter.
- You should see a confirmation message: "Successfully flushed the DNS Resolver Cache."
That's it. This command clears the DNS resolver cache on your Windows Operating System. This works well for most situations.
What to Do After Flushing DNS
Sometimes, simply flushing the DNS isn't enough. You might need to renew your IP address or register your DNS settings again. This helps ensure your computer gets fresh network information from your router or DHCP server.
- Release Your IP Address:
- In the same elevated Command Prompt, type:
ipconfig /release - Press Enter. This command releases your current IP address, effectively disconnecting you from your network (briefly).
- Renew Your IP Address:
- After releasing, type:
ipconfig /renew - Press Enter. Your computer will request a new IP address from the DHCP server. This process can take a few moments.
- Register Your DNS Settings (Optional but Recommended):
- Finally, type:
ipconfig /registerdns - Press Enter. This command refreshes all DHCP leases and re-registers DNS names. It’s a good final step to ensure everything is aligned.
Using ipconfig /renew in conjunction with ipconfig /flushdns often provides a more thorough network reset. Remember, on older versions like Windows 7, Vista, and XP, running Command Prompt as administrator is also needed for this to work correctly.
Alternative Method (Not Recommended for Most Users)
While you can initiate ipconfig /flushdns via the "Start -> Run" dialog, it's not the best practice. This method doesn't open an elevated Command Prompt by default. This means the command might not execute successfully, especially if you lack administrator privileges. Stick to running Command Prompt as administrator. It ensures the command runs with the necessary permissions.
Flush DNS: Mac, Linux, Mobile
Flushing your DNS cache isn't just a Windows thing. Other operating systems and devices also maintain local DNS caches. Clearing these can be just as beneficial for resolving connectivity issues on those platforms.
macOS DNS Flush
Apple's macOS also keeps a DNS cache, and its flush command varies slightly depending on your macOS version. The general approach involves the Terminal.
- Open Terminal: Go to Applications > Utilities > Terminal.
- Execute Command:
- For macOS Sierra, High Sierra, Mojave, Catalina, Big Sur, Monterey, Ventura, Sonoma:
sudo killall -HUP mDNSResponder - You'll need to enter your administrator password.
- For older versions like OS X Yosemite:
sudo discoveryutil mdnsflushcache - And for OS X Lion, Mountain Lion, Mavericks:
sudo killall -HUP mDNSRespondersudo killall -HUP mDNSResponderHelpersudo dscacheutil -flushcache
The sudo killall -HUP mDNSResponder command is widely used and typically effective for recent macOS versions.
Linux DNS Flush
Linux distributions handle DNS caching in various ways. Many systems use a service like nscd (Name Service Cache Daemon) or systemd-resolved. So, flushing DNS often involves restarting these services.
- Open Terminal: Use
Ctrl+Alt+Tor find it in your applications. - Check for
nscd:
sudo systemctl restart nscd(Ifnscdis running)
- Check for
systemd-resolved:
sudo systemctl restart systemd-resolved(If usingsystemd-resolved)- Or, to clear the cache specifically:
sudo resolvectl flush caches
Some Linux systems don't run a local DNS caching service by default. In such cases, there's no cache to flush locally. Your system relies directly on your router or external DNS servers.
Mobile Devices (iOS & Android)
Mobile operating systems also have DNS caching mechanisms, but they don't offer a direct "flush DNS" command to users.
- iOS (iPhone/iPad): Typically, you can clear the cache by resetting network settings (
Settings > General > Transfer or Reset iPhone > Reset > Reset Network Settings). This clears Wi-Fi passwords and other network configurations. Another simpler trick is to toggle Airplane Mode on and off. - Android: Similar to iOS, there isn't a single command. Clearing browser cache and data often helps for browser-related issues. For system-wide problems, toggling Airplane Mode or restarting the device can often achieve a similar effect. Sometimes, you need to clear the cache for specific apps through
Settings > Apps > [App Name] > Storage > Clear Cache.
Verify Your Fix & Next Steps
Flushing your DNS cache is one thing; confirming it actually worked is another. We need to verify that the old, potentially corrupted entries are gone.
How to Verify a DNS Flush on Windows
The ipconfig /displaydns command shows the current contents of your DNS resolver cache on Windows.
- Open Command Prompt as Administrator (as you did for flushing).
- Type:
ipconfig /displaydns - Press Enter.
Before flushing, this command would show a long list of cached DNS entries. After a successful ipconfig /flushdns command, running ipconfig /displaydns should show a much shorter list, perhaps even empty, with just a few system entries. If you still see a long list of previously visited websites, the flush might not have taken effect, or you didn't run Command Prompt as administrator.
What to Do If Issues Persist
Sometimes, even after verifying a flush, problems remain. Don't panic. This just means the DNS cache wasn't the root cause.
- Check Your Router: Restart your router and modem. They also maintain their own DNS caches and can experience issues. Unplug them for 30 seconds, then plug them back in.
- Change DNS Servers: Your computer usually gets its DNS server addresses from your router, which in turn gets them from your Internet Service Provider (ISP). If your ISP's DNS servers are slow or problematic, changing to public DNS servers like Google DNS (8.8.8.8 and 8.8.4.4) or Cloudflare DNS (1.1.1.1 and 1.0.0.1) can often improve speed and reliability.
- Malware Scan: Run a full system scan with reputable antivirus software (e.g., Microsoft Defender, Bitdefender, Norton). Malware can interfere with network settings, including DNS.
- Network Adapter Reset: Sometimes, the issue lies with your network adapter. You can reset it via Device Manager or the Network & Internet settings in Windows.
- Browser Cache: Your web browser (Chrome, Firefox, Edge, Safari) also keeps its own cache. Clear your browser's cache and cookies to ensure it's not serving you old content.
Advanced DNS Troubleshooting
Understanding the basics of flushing DNS is a great start. But the Domain Name System is complex. Diving a bit deeper can help you solve more nuanced problems and optimize your network. We're talking about more than just clearing out old entries.
Understanding Time-To-Live (TTL)
Every DNS record has a Time-To-Live (TTL) value. This number tells your DNS resolver cache how long it should store that record before querying the authoritative DNS server again. A high TTL means less frequent updates but faster subsequent lookups. A low TTL ensures quicker propagation of changes but can mean more queries.
When a website owner changes their IP Address, they usually lower the TTL of their DNS records beforehand. This ensures that old records expire quickly from caches worldwide. If your local cache ignores or misinterprets TTL values due to corruption, you'll keep hitting the old, incorrect address. Flushing bypasses this waiting period, forcing immediate new lookups.
Public DNS vs. ISP DNS
Most users rely on their ISP's DNS servers by default. These are fine for general browsing. However, public DNS servers offer alternatives with potential benefits:
- Speed: Providers like Cloudflare (1.1.1.1) and Google (8.8.8.8) often boast faster resolution times.
- Reliability: Redundant global networks mean less downtime.
- Security Features: Some public DNS services offer built-in malware blocking or phishing protection. For instance, Cloudflare's 1.1.1.2 blocks malware, and 1.1.1.3 blocks malware and adult content.
- Privacy: Some providers, like Cloudflare, emphasize privacy, committing not to log your IP address or sell your data. This aligns with principles found in regulations like GDPR and CCPA.
Changing your DNS server settings can be done at the router level (affecting all devices) or on individual devices. On Windows, you access this through Network & Internet Settings > Change adapter options > Right-click your active adapter > Properties > Internet Protocol Version 4 (TCP/IPv4) > Properties.
DNSSEC and Security
DNS, by its original design, wasn't built with security in mind. This made it vulnerable to attacks like DNS spoofing. DNSSEC (DNS Security Extensions) adds security to the DNS lookup process. It authenticates DNS data, ensuring that the information you receive hasn't been tampered with. It uses digital signatures to verify the origin of DNS records.
While flushing your local cache is a manual security measure, DNSSEC works at a deeper, infrastructural level. It's a critical standard that helps protect the integrity of the internet's naming system. Your local machine doesn't directly implement DNSSEC, but your chosen DNS resolver might. Using a public DNS server that supports DNSSEC, like Google DNS or Cloudflare DNS, adds an extra layer of trust to your lookups. We, as users, benefit from these larger efforts to secure the underlying internet infrastructure.
DNS Commands: Quick Comparison
Different operating systems require distinct commands to achieve the same goal: flushing the DNS cache. Understanding these differences helps in multi-platform environments.
| Operating System | Command | Notes |
|---|---|---|
| Windows | ipconfig /flushdns |
Requires Command Prompt run as administrator. |
| macOS | sudo killall -HUP mDNSResponder |
Command may vary slightly by macOS version; requires admin password. |
| Linux (systemd-resolved) | sudo systemctl restart systemd-resolved or sudo resolvectl flush caches |
Depends on the specific DNS caching service running on the distribution. |
| Linux (nscd) | sudo systemctl restart nscd |
Only if nscd is installed and running. |
| Mobile (iOS/Android) | None directly; network reset or device restart | No direct user-accessible command; requires broader network reset. |
This table highlights the specific tools and approaches needed for each major platform. As you can see, the Windows Operating System provides a direct, easy-to-remember command through its ipconfig utility.
Common Questions About Flushing
People often have lingering questions about DNS flushing. Let's tackle some of the most frequent ones.
Will flushing DNS make my internet faster?
Not directly. Flushing DNS removes old, potentially incorrect entries. If those entries were causing slow lookups or connection errors, then yes, it can make your internet feel faster because pages load correctly and without delay. But it won't magically boost your bandwidth.
How often should I flush my DNS cache?
You don't need to do it regularly unless you're experiencing issues. Most DNS entries expire naturally based on their Time-To-Live (TTL). Flush your DNS when you:
- Can't access a specific website.
- See "page not found" errors for sites you know exist.
- Suspect you're visiting an outdated version of a site.
- Have changed your DNS servers.
- Are troubleshooting network connectivity.
Does flushing DNS affect other devices on my network?
No. Flushing the DNS cache on your Windows computer only clears the cache on that specific device. It doesn't affect your router's DNS cache, nor does it affect other computers, phones, or tablets connected to your network. Each device maintains its own local cache.
Is flushing DNS safe?
Absolutely. It's a standard and safe troubleshooting step. The worst that can happen is a very slight, temporary delay when you first visit a website after flushing. This happens because your computer now has to perform a new DNS lookup, rather than pulling the record from its local cache. It’s a minor trade-off for ensuring you have fresh, accurate network information. This process, which shows you how to flush dns cache on windows, cleans out old entries that slow down your connection.
Your Next Move
Check your current network connectivity now. If you're facing slow loading times or persistent website errors, reset your local DNS Cache immediately to prevent further frustration. Use the ipconfig /flushdns command via an elevated Command Prompt to clean out any corrupted entries.
Aman Kharwar
Founder & Editor-in-ChiefSenior Technical Analyst and Cyber Security Expert at Not Your Tech. Passionate about simplifying complex technology for the modern audience.



