
Flush DNS on Windows 10 & 11: ipconfig /flushdns (2026)
Flush the DNS cache on Windows 10 and 11 with ipconfig /flushdns. Step-by-step command, verification, and fixes when changes still do not apply.
Manage hosts files without the terminal
ToggleHosts helps you manage environments visually on Windows, macOS, and Linux, with automatic DNS flush and backups.
One-time payment
Need to flush the DNS cache on Windows right now? Open Command Prompt or PowerShell and run:
ipconfig /flushdnsUse it after editing the hosts file, changing DNS servers, testing a migration, or when a domain still resolves to an old IP address. Need every platform in one place? See how to flush the DNS cache on Windows, macOS and Linux.
How to flush DNS on Windows 10 and 11
To flush DNS on Windows, run ipconfig /flushdns from Command Prompt or PowerShell:
- Press the Windows key, type cmd (or PowerShell), and open it.
- Run
ipconfig /flushdns. - Wait for "Successfully flushed the DNS Resolver Cache."
- Verify resolution with
nslookup myproject.testoripconfig /displaydns. - Reload the page in a fresh browser tab.
If Windows returns an elevation or access error, reopen the terminal with Run as administrator.
The same command works on Windows 10 and Windows 11.
Flush DNS with PowerShell (Clear-DnsClientCache)
If you prefer PowerShell, it ships a native cmdlet that does the same job as ipconfig /flushdns:
Clear-DnsClientCacheInspect what is cached before you clear it with Get-DnsClientCache. Both cmdlets are convenient in scripts and CI runners where you automate a DNS reset.
When to flush DNS on Windows
- You edited
C:\Windows\System32\drivers\etc\hostsbut the browser still opens the old site. - You switched DNS resolvers (Cloudflare 1.1.1.1, Google 8.8.8.8, a VPN).
- You moved a staging site to a new server before DNS propagation.
For the full editing workflow, see how to edit the hosts file on Windows.
Verify the result
ipconfig /displaydns
nslookup myproject.testIf the command line resolves correctly but the browser does not, the browser is caching the old result.
Clear the browser DNS cache too
- Chrome / Edge: when available, open
chrome://net-internals/#dns(oredge://net-internals/#dns) and click Clear host cache. Otherwise restart the browser. - Firefox: open
about:networking#dnsand click Clear DNS Cache.
Reload in a new tab after clearing the browser cache.
Troubleshooting
- "The requested operation requires elevation": reopen the prompt as administrator.
- Change still ignored: confirm the hosts line is
IP<space>hostnamewith nohttp://or port, then flush again. - Only one app affected: restart that app; some keep long-lived connections.
- WSL2 still resolves the old IP: WSL2 keeps its own resolver, separate from Windows. Inside the distro run
sudo resolvectl flush-caches, or runwsl --shutdownfrom Windows to restart it cleanly.
If you switch local domains often, a visual hosts manager like ToggleHosts edits the file safely and flushes DNS for you, avoiding malformed lines and forgotten flushes.
Prefer a one-click demo on Windows 11?
How to Flush DNS on Windows 11 Without Command Prompt (One Click) · @ToggleHosts_app
_Last tested: June 2026 on Windows 11 23H2 and Windows 10 22H2._
Sources and further reading
- How DNS works (Cloudflare Learning)
- ipconfig command reference (Microsoft Learn)
- The hosts file explained (Wikipedia)
Frequently Asked Questions
Open Command Prompt or PowerShell and run ipconfig /flushdns. It clears the Windows DNS resolver cache.
Start with your usual Command Prompt or PowerShell. If Windows returns an access error, reopen it as administrator; managed devices can also require elevation.
You will see "Successfully flushed the DNS Resolver Cache." Verify resolution with ipconfig /displaydns or nslookup yourdomain.test.
Your browser may keep its own cache or an active connection. Clear its DNS cache when that control is available, restart it if needed, and confirm the hosts file entry is correct.
Run Clear-DnsClientCache in a PowerShell window. Use Get-DnsClientCache first if you want to inspect the cached entries before clearing them.
WSL2 keeps a separate resolver from Windows. Run sudo resolvectl flush-caches inside the distro, or run wsl --shutdown from Windows to restart it.
Related Articles
How to Flush DNS Cache on Windows, macOS & Linux (2026)Flushing DNS & cache
How to Flush DNS Cache on Windows, macOS & Linux (2026)
8 min read
How to Flush DNS Cache on Linux (Ubuntu 24.04, Debian & RHEL)Flushing DNS & cache
How to Flush DNS Cache on Linux (Ubuntu 24.04, Debian & RHEL)
3 min read
Flush DNS on Mac: Command for Sequoia, Sonoma & Tahoe (2026)Flushing DNS & cache
Flush DNS on Mac: Command for Sequoia, Sonoma & Tahoe (2026)
6 min read