How to Flush the DNS Cache in Windows 11 Command Line
Flushing the DNS cache clears stored records of website addresses your PC has looked up, which resolves issues where a site fails to load or points to an outdated address. Windows 11 does this with a single TANGKAS39 Command Prompt command.
The Command
ipconfig /flushdns
What It Does
This command clears the DNS resolver cache, the local store of domain-name-to-address mappings your system has recently used. After flushing, your PC looks up fresh addresses the next time you visit sites, which fixes problems caused by stale or incorrect cached entries. You should see a message confirming the cache was successfully flushed.
When You’d Use This
This is a go-to fix when a website will not load correctly, loads an outdated version, or fails after a site changed servers, since a stale cached address can be the cause. It is a safe, quick troubleshooting step to try early when a specific site misbehaves while the rest of your connection works fine, clearing outdated address lookups.
Useful Variations
To view the current cache before clearing it, use `ipconfig /displaydns`. Related refresh commands include `ipconfig /registerdns` to refresh DHCP leases and re-register DNS names. In PowerShell, `Clear-DnsClientCache` does the same job as flushing, offering an alternative if you are working in PowerShell rather than Command Prompt.
If It Doesn’t Work
If flushing does not help, the problem likely lies elsewhere, such as with your DNS server, the website itself, or your connection, so try other steps like renewing your IP or testing a different site. Flushing is harmless and affects only cached lookups, not passwords or history, so it is always safe to try, but it only resolves issues actually caused by stale cache entries.
Good to Know
Flushing the DNS cache is a safe, common troubleshooting step that does not affect your saved passwords or browsing history, only cached address lookups. If a website still fails to load after flushing, the issue may lie with your DNS server, the site itself, or your connection rather than the cache.
Putting It Together
Once you have run it once or twice, this becomes second nature. As part of diagnosing and configuring your connection, this command belongs in your toolkit for whenever the network acts up. Used alongside the other networking commands here, it helps you methodically work from confirming basic connectivity to pinpointing exactly where a problem lies. Like anything in the terminal, the real value comes from trying it on your own system and adapting the variations above to what you actually need, so it is worth experimenting with in a safe, low-stakes situation before relying on it in a script or during troubleshooting. Keeping a note of the commands you find most useful, along with the variations that fit your workflow, turns scattered one-off tricks into a personal reference you can draw on whenever a similar task comes up again.