How-to

How to flush the DNS cache on Windows

Last updated November 10, 2026

To flush the DNS cache on Windows 11 or Windows 10, open Command Prompt, type ipconfig /flushdns and press Enter. Windows answers with "Successfully flushed the DNS Resolver Cache." The cache is emptied on the spot: no restart, and nothing you have open gets closed.

The command is identical on Windows 8 and 7 and on Windows Server, so everything here applies to those as well. This guide covers the three ways to run it, how to look inside the cache, and what the error messages mean when the flush fails. For other systems, see the overview for every device.

Flush DNS with Command Prompt

  1. Press Win + R to open the Run box.
  2. Type cmd and press Enter. A black Command Prompt window opens.
  3. Type (or paste) the command below and press Enter.
ipconfig /flushdns

Windows replies with two lines:

Windows IP Configuration

Successfully flushed the DNS Resolver Cache.

That message is the whole process. On Windows 10 and 11 a normal Command Prompt window is usually enough. If you get "The requested operation requires elevation" instead, open Start, type cmd, choose Run as administrator and run the command again.

Flush DNS with PowerShell or Windows Terminal

Right-click the Start button (or press Win + X) and choose Terminal on Windows 11 or Windows PowerShell on Windows 10. ipconfig /flushdns works here exactly as it does in Command Prompt. PowerShell also has a command of its own for the same job:

Clear-DnsClientCache

It prints nothing when it succeeds, which is normal for PowerShell. The cmdlet ships with Windows 8 and later and is the better choice inside scripts. Microsoft documents it in the DnsClient module reference.

Flush DNS without opening a terminal

If you only want the result, skip the terminal. Press Win + R, type ipconfig /flushdns straight into the Run box and press Enter. A window flashes up for a split second and closes again. That was the flush. You will not get to read the confirmation, but the cache is empty.

If you need the command often, as web developers tend to, put it on the desktop: right-click the desktop, choose New → Shortcut, enter ipconfig /flushdns as the location and give the shortcut a name. From then on a double-click flushes the cache.

See what is in the DNS cache

Windows lets you read the cache, which is handy for checking a flush and for seeing what a stale entry looked like before you removed it:

ipconfig /displaydns

The output is long: one block per name with the record type, the remaining TTL in seconds and the address. To list only the names, filter it (the filter matches the English-language output):

ipconfig /displaydns | findstr /c:"Record Name"

In PowerShell, Get-DnsClientCache shows the same data as a table. Run either one directly after a flush and the list is empty or nearly so. It fills up again within seconds, because Windows and your open programs keep looking up names in the background.

What ipconfig /flushdns does (and does not do)

Windows runs a background service called DNS Client (internal name Dnscache). It stores every DNS answer your PC receives until the record's TTL expires. It also remembers failed lookups for a short while, so a name that did not exist a minute ago can keep failing even after it has been created. ipconfig /flushdns wipes both kinds. Microsoft's ipconfig reference describes it as the way to "discard negative cache entries from the cache, as well as any other entries that have been added dynamically".

What the command leaves alone:

  • Entries from your hosts file (C:\Windows\System32\drivers\etc\hosts). Windows loads those again right away, and they always win over DNS.
  • The DNS cache inside Chrome, Edge and Firefox.
  • The cache in your router and at your DNS provider.
  • Your IP address, Wi-Fi passwords, browser history and everything else on the PC.

Clear the browser's DNS cache too

Chrome, Edge and Firefox each keep their own list of resolved names. If a site still loads from the old address after the Windows flush, clear the browser as well:

  • Chrome: open chrome://net-internals/#dns and click Clear host cache.
  • Edge: open edge://net-internals/#dns and click Clear host cache.
  • Firefox: open about:networking#dns and click Clear DNS Cache.

If the browser uses secure DNS (DNS over HTTPS), it bypasses the Windows DNS cache completely, and this step is the one that matters. Look for "Use secure DNS" in the browser's privacy and security settings to see whether it is on. The browser section of the overview has more detail, including Safari and Brave.

Still not working? Reset the network stack

When a flush alone does not fix name resolution, the usual next step is to renew the whole network configuration. Open Command Prompt as administrator (Start, type cmd, Run as administrator) and run these one at a time:

  1. ipconfig /flushdns clears the DNS cache.
  2. ipconfig /release gives up your current IP address. You go offline for a moment.
  3. ipconfig /renew requests a fresh address from the router.
  4. netsh winsock reset resets the Windows socket catalog, which broken VPN clients and security tools sometimes leave damaged.
  5. Restart the PC. The Winsock reset only takes effect after a reboot.

Steps 2 and 3 drop the connection briefly, so do not run them over a remote desktop session. Afterwards you can confirm the address you ended up with by following how to find your IP address on Windows.

Error messages and what they mean

"The requested operation requires elevation." The window does not have administrator rights. Close it, open Start, type cmd, right-click Command Prompt and choose Run as administrator.

"Could not flush the DNS Resolver Cache: Function failed during execution." The DNS Client service is not running, so there is no cache to flush. This usually happens after a tuning or privacy tool disabled the service. On Windows 10 and 11 the service cannot be changed in the Services app (the options are greyed out). Open the Registry Editor instead, go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache, set the Start value to 2 and restart the PC.

"'ipconfig' is not recognized as an internal or external command." The system's PATH variable is damaged. Run the tool by its full path instead: C:\Windows\System32\ipconfig.exe /flushdns.

The flush succeeds but the old site still appears. Check, in this order: the browser's DNS cache, a leftover line in the hosts file, an active VPN (which brings its own DNS servers), and your router. If the DNS record was changed within the last few hours, your provider's resolver may simply still be serving the old one. Our DNS lookup shows what the record says right now.

Frequently asked questions

Do I need administrator rights to run ipconfig /flushdns?

Usually not. On Windows 10 and 11 the command works in a normal Command Prompt or Terminal window. If you see "The requested operation requires elevation", open the terminal with Run as administrator and try again. ipconfig /registerdns and netsh winsock reset always need an administrator window.

How do I know the DNS flush worked?

Windows prints "Successfully flushed the DNS Resolver Cache." To double-check, run ipconfig /displaydns right afterwards: the list of cached names should be empty or very short.

Do I have to restart my PC after flushing DNS?

No. The flush takes effect immediately and running programs keep working. Only a Winsock reset (netsh winsock reset) requires a restart.

What is the difference between ipconfig /flushdns, /release and /renew?

/flushdns empties the DNS cache, the list of names and addresses Windows has remembered. /release and /renew deal with your own IP address: the first gives it back to the router, the second requests a new one. They solve different problems and are often run together when resetting a connection.

Does flushing DNS lower ping or fix lag in games?

No. DNS is only used to find a server's address when you connect. Once the connection is up, ping depends on the route between you and the server, which the DNS cache has no influence on. A flush can help if a game cannot find its servers at all.

Is the command the same on Windows 10 and Windows 11?

Yes. ipconfig /flushdns works identically on Windows 11, 10, 8 and 7 and on Windows Server. Only the way you open a terminal differs: Windows 11 calls it Terminal, Windows 10 offers Command Prompt and Windows PowerShell.

How do I clear the DNS cache in Chrome on Windows?

Type chrome://net-internals/#dns into the address bar and click Clear host cache. Chrome keeps this cache separately from Windows, so it is worth clearing both when a site still loads from an old address.