When a website won't load on your gaming PC but opens fine on your phone, or a service has moved and your PC keeps trying the old address, a stale DNS cache can be the cause. Windows keeps a local copy of recent DNS lookups so it doesn't have to ask your DNS server every time, and clearing it is one of the quickest network fixes there is.
What the DNS cache is
DNS turns names such as forgepc.co.uk into IP addresses. Windows' DNS Client service keeps a resolver cache of recent answers. According to Microsoft, that cache holds entries preloaded from your local Hosts file plus recently obtained records, and Windows checks it before querying your configured DNS servers.
Flushing it, in Microsoft's words, "flushes and resets the contents of the DNS client resolver cache", which discards negative cache entries (remembered failures) and other dynamically added entries. Your PC then looks names up fresh the next time you visit a site.
When flushing the DNS cache helps
A site fails to load on one PC while other devices on the same network are fine.
You've just changed your DNS server in Windows 11 and want new lookups to use it straight away.
A site or server has recently moved and your PC still seems to reach the old one.
You're troubleshooting a "server not found" style error and want to rule DNS out.
It won't fix a dead connection, a faulty cable or Wi-Fi dropouts. For those, see our guides to fixing Ethernet not working in Windows 11 and fixing Wi-Fi disconnecting in Windows 11.
Method 1: Flush DNS with Command Prompt
Right-click the Start button and open Terminal, or search for Command Prompt in the Start menu.
Type ipconfig /flushdns and press Enter.
Windows should confirm that the DNS resolver cache has been flushed.
ipconfig /flushdns
If you get an access or permissions error, close the window, open Terminal or Command Prompt with Run as administrator, and try again.
Method 2: Flush DNS with PowerShell
PowerShell has its own command for the same job. Microsoft says running Clear-DnsClientCache is equivalent to running ipconfig /flushdns.
Search for PowerShell in the Start menu, or open a PowerShell tab in Terminal.
Type Clear-DnsClientCache and press Enter.
Clear-DnsClientCache
As with Command Prompt, use an administrator window if you get a permissions error.
How to check what's in the DNS cache
You can look at the cache before and after flushing to confirm it worked. In Command Prompt, use:
ipconfig /displaydns
Or in PowerShell:
Get-DnsClientCache
Microsoft describes /displaydns as showing the contents of the DNS client resolver cache, including entries from the Hosts file. So even straight after a flush you may still see a few entries if your Hosts file contains any.
Other ipconfig commands worth knowing
The same ipconfig tool can help with wider network problems. Microsoft documents these switches:
Command | What it does |
|---|
ipconfig /all
| Shows the full TCP/IP configuration for every adapter |
ipconfig /release
| Releases the current DHCP-assigned IPv4 configuration |
ipconfig /renew
| Renews the DHCP configuration (only for adapters set to get an IP address automatically) |
ipconfig /registerdns
| Starts manual dynamic DNS registration for the PC's names and IP addresses |
Microsoft notes that /release disables TCP/IP on adapters set to get an IP address automatically, so that adapter loses its connection until you run /renew, so run them one after the other and don't do it in the middle of a game or download. If you use a fixed address, as in our static IP guide, /renew won't apply, because it only works on adapters configured to obtain an IP address automatically.
If sites still won't load
Close and reopen your browser, then try again.
Restart the PC and your router.
Try a different DNS server, as covered in our DNS guide above.
Our verdict
Flushing the DNS cache is safe, quick and worth trying whenever one PC can't reach a site that works elsewhere, or after you change DNS servers. Run ipconfig /flushdns in Command Prompt or Clear-DnsClientCache in PowerShell (they do the same thing, according to Microsoft), using an administrator window if you get a permissions error. If that doesn't help, the problem is likely your connection, router or DNS server rather than the cache.