Networking · How-To
How to Flush the DNS Cache in Windows
Open Command Prompt or PowerShell and run ipconfig /flushdns. Windows replies that it has Successfully flushed the DNS Resolver Cache, and every future name lookup starts fresh. That single command fixes most cases where a site has moved to a new server but your PC keeps reaching the old address.
The rest of this guide explains what the DNS resolver cache actually is, how to look inside it, how to clear it from PowerShell, how to re-register your DNS names, why browsers keep their own separate cache, and — just as important — the times when flushing will not help so you do not waste time on it.
Any supported version of Windows 10 or Windows 11. A plain ipconfig /flushdns needs no
special rights. A few related commands — ipconfig /registerdns and the PowerShell
Clear-DnsClientCache — need an administrator window.
What the DNS resolver cache is
Every time you visit a website, your PC has to turn a human-friendly name such as
example.com into the numeric IP address a computer can actually connect to. That translation
is the job of DNS, the Domain Name System. Because looking a name up over the network takes time, Windows
keeps the answers it has already received in a small in-memory table called the DNS client
resolver cache, managed by the DNS Client service (its internal name is
Dnscache).
The cache is a performance feature: the second time you visit a site, Windows can reuse the stored address instead of asking again. Each record carries a time-to-live (TTL) that decides how long it stays valid. The trouble starts when a record is still cached but no longer correct — for example a website has moved to a new host, you have just changed your router's DNS servers, or a temporary DNS outage left a "does not exist" answer stuck in the cache. Flushing clears the table so the next lookup fetches a fresh, accurate answer.
1. Flush the cache with ipconfig /flushdns
- Press Start, type cmd or PowerShell, and open it. You do not need to run it as administrator just to flush.
- Run:
ipconfig /flushdns - You should see the confirmation line: Successfully flushed the DNS Resolver Cache.
That is the whole operation. There is nothing to restart and nothing is lost — the cache simply rebuilds itself from your next lookups. If a website that just changed hosting still will not load correctly, this is almost always the first thing to try.
If your connection itself is misbehaving, it can help to renew your address at the same time:
ipconfig /release then ipconfig /renew to get a fresh DHCP lease, followed by
ipconfig /flushdns. Run these from an administrator prompt.
2. Look inside the cache with ipconfig /displaydns
Before you flush — or just to understand what your PC is holding — you can print the current contents of the resolver cache:
ipconfig /displaydns
The output lists each cached record: the name being looked up, the record type (an
A record is an IPv4 address, AAAA is IPv6), the remaining time-to-live,
and the answer. The list also includes entries preloaded from your local hosts file, exactly as
the ipconfig command reference on Microsoft Learn describes. If you
run ipconfig /displaydns immediately after a flush, you will see the cache is nearly empty,
which is a quick way to confirm the flush worked.
3. Flush from PowerShell (Clear-DnsClientCache)
If you prefer PowerShell — or you are working inside a script — Windows has a dedicated cmdlet. Open PowerShell as administrator and run:
Clear-DnsClientCache
Microsoft documents this cmdlet as equivalent to running ipconfig /flushdns: it deletes the
contents of the DNS client cache. To inspect the cache the PowerShell way, use its companion cmdlet
Get-DnsClientCache, which
returns the same records as structured objects you can filter and sort:
Get-DnsClientCache
Because it is a cmdlet, Clear-DnsClientCache also accepts parameters such as
-CimSession to clear the cache on a remote computer, which is convenient for administrators
managing several machines.
4. Re-register your DNS names
Flushing removes stale answers your PC has received. A related command handles the other direction — making sure the network knows the correct name and address for your computer. From an administrator prompt:
ipconfig /registerdns
This renews any DHCP leases and re-registers the computer's DNS names with the DNS server. It is mostly useful on managed or corporate networks where machines register their own names in DNS; on a typical home network you will rarely need it, but it does no harm and can clear up name-registration glitches after a network change.
5. Browsers keep their own DNS cache
Here is the detail that trips people up: web browsers cache DNS lookups separately from Windows. You can flush the Windows resolver cache perfectly and still land on the old address, because the browser served the answer from its own internal cache. Clearing the Windows cache does not touch it.
To clear a browser's own DNS cache, open its network-internals page and use the DNS controls there:
- Chrome / Edge and other Chromium browsers: visit
chrome://net-internals/#dns(oredge://net-internals/#dns) and choose Clear host cache. - Firefox: the simplest reliable fix is to close and reopen the browser, which clears its in-memory DNS cache.
If a page still looks wrong after clearing both caches, do a hard refresh with Ctrl+F5 to bypass the browser's page cache, which is a different cache again from DNS.
When flushing helps — and when it will not
Flushing is the right move when the address your PC holds is stale. It helps with cases like these:
- A site has moved to new hosting and you are still reaching the old server.
- You just changed your DNS servers (for example to
1.1.1.1or8.8.8.8) and want the change to take effect immediately. - A brief DNS outage left a "cannot find server" answer cached even though the site is back.
- You edited your
hostsfile and want Windows to pick up the change.
Flushing will not help when the problem is not a stale record. If the site is genuinely down, your internet connection is dropping, or your DNS server itself is unreachable, an empty cache changes nothing — the next lookup fails just the same. In those situations the fault is upstream, and the fix is to check the connection or switch DNS servers rather than to keep flushing.
Repeatedly flushing an empty cache achieves nothing. If names still will not resolve, the next step is to work through the DNS server itself — see our guide on fixing "DNS server not responding", which covers changing DNS servers, restarting the DNS Client service and resetting the TCP/IP stack.
Frequently asked
Do I need administrator rights to flush the DNS cache?
No. The ipconfig /flushdns command runs in an ordinary Command Prompt or PowerShell window without administrator rights, and it clears the whole DNS resolver cache. You only need an elevated session for related commands such as ipconfig /registerdns or Clear-DnsClientCache, which require administrator privileges to run.
Does flushing the DNS cache delete cookies, history or passwords?
No. Flushing the DNS cache only clears the temporary table that maps host names to IP addresses. It does not touch your browsing history, cookies, saved passwords, bookmarks or any personal files. The worst that happens is that the next visit to each site takes a fraction of a second longer while Windows looks the address up again.
Why does my browser still load the old site after I flush the cache?
Browsers keep their own DNS cache that is separate from the Windows resolver cache, so a Windows-level flush does not clear it. Clear the browser's internal cache from its net-internals DNS page, or simply close and reopen the browser. Some sites also stay cached in the page cache, so a hard refresh with Ctrl+F5 can help too.
How is Clear-DnsClientCache different from ipconfig /flushdns?
They do the same job. Clear-DnsClientCache is the PowerShell cmdlet that deletes the contents of the DNS client cache, and Microsoft documents it as equivalent to running ipconfig /flushdns. Use whichever fits your workflow; the cmdlet is handy inside scripts and can target remote computers, while ipconfig is quicker to type at a prompt.
Fix name-resolution errors with DNS server not responding, run your own resolver with set up DNS on Windows Server, lock down an address with set a static IP in Windows 11, or browse all networking guides.