Skip to content

How-ToOS

How to Flush the DNS Cache in Windows 11

How to flush the DNS cache in Windows 11: run ipconfig /flushdns in Command Prompt or Clear-DnsClientCache in PowerShell, which Microsoft says do the same thing. It helps when one PC can't reach a site that works elsewhere, or after you change DNS servers.

By , Systems & Technical Editor

3 min read

How to Flush the DNS Cache in Windows 11

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

  1. Right-click the Start button and open Terminal, or search for Command Prompt in the Start menu.

  2. Type ipconfig /flushdns and press Enter.

  3. 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.

  1. Search for PowerShell in the Start menu, or open a PowerShell tab in Terminal.

  2. 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.

The bottom line

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.

Sources

  1. 01Microsoft Learn, ipconfig
  2. 02Microsoft Learn, Clear-DnsClientCache
  3. 03Microsoft Learn, Get-DnsClientCache

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

2.4GHz vs 5GHz vs 6GHz Wi-Fi: Which Band Should Your PC Use?

Versus

2.4GHz vs 5GHz vs 6GHz Wi-Fi: Which Band Should Your PC Use?

2.4GHz vs 5GHz vs 6GHz Wi-Fi for a PC: 2.4GHz reaches furthest but is slowest and most crowded, 5GHz suits most gaming PCs, and 6GHz is fastest and least congested at short range with a Wi-Fi 6E/7 router, adapter and Windows 11. Ofcom widened UK 6GHz Wi-Fi on 10 Nov 2026.

Callum Reid4 min

SGLang vs vLLM: Which LLM Serving Engine Should You Run on Your PC?

Versus

SGLang vs vLLM: Which LLM Serving Engine Should You Run on Your PC?

SGLang vs vLLM for a local AI server: both are fast, open-source LLM serving engines with OpenAI-compatible APIs that run on Linux. vLLM supports more home hardware, including AMD Radeon RX 7900 and RX 9000 cards, while SGLang suits recent NVIDIA RTX cards and agent-heavy workloads.

Callum Reid6 min