Quick fix: Open Terminal (Admin) and run ipconfig /flushdns. The local DNS resolver cache is cleared in under a second. For browser-side cache, also visit edge://net-internals/#dns in Edge or chrome://net-internals/#dns in Chrome and click Clear host cache.
You changed the DNS record on a domain you own. Other people see the new IP, but your PC keeps connecting to the old one. Or a website that just came back online is still showing “site can’t be reached” for you. Windows caches DNS lookups locally for performance — until the cache TTL expires, you get stale records. Flushing forces fresh lookups.
Affects: Windows 11 (and Windows 10) DNS Client service.
Fix time: ~2 minutes.
What causes this
When your PC looks up a domain, Windows’s DNS Client service caches the result for the duration of the record’s TTL (time-to-live). For most records, TTL is 5 minutes to 1 hour. During that window, repeated lookups return the cached IP without re-querying DNS. When the record changes (you updated the A record at the registrar), the cache lags behind — you continue using the old IP until TTL expires.
Browsers add a second layer: Chrome, Edge, and Firefox each maintain their own internal DNS cache, separate from Windows’s. So even after ipconfig /flushdns, the browser might still use its stale entry.
Method 1: Flush the Windows DNS cache
The standard route.
- Open Terminal (Admin): right-click Start → Terminal (Admin).
- Run:
ipconfig /flushdnsOutput: Successfully flushed the DNS Resolver Cache.
- Verify cache is empty:
ipconfig /displaydns. Should show no entries (or very few entries that have been re-queried since flush). - Try the lookup that was stale:
nslookup example.com. The result is queried fresh from your DNS server. - For a one-line PowerShell equivalent:
Clear-DnsClientCache. Same effect, doesn’t need admin in some configurations. - Restart the DNS Client service for a stronger flush:
net stop dnscache net start dnscacheThis also clears any in-memory state the service holds beyond the displayed cache.
This is the canonical command. Used by sysadmins for every DNS-cache-related issue.
Method 2: Clear browser DNS cache separately
For when Windows cache flush doesn’t resolve and a browser is still stuck.
- In Edge: type
edge://net-internals/#dnsin address bar. Click Clear host cache. - In Chrome:
chrome://net-internals/#dns. Click Clear host cache. - In Firefox:
about:networking#dns. Click Clear DNS Cache. - Also clear browser’s general cache:
Ctrl + Shift + Delete→ tick Cached images and files → click Clear. - Close all browser windows fully and reopen. Some browsers don’t flush in-memory cache until restart.
- For Outlook/Teams (which use Edge WebView2 internally): close fully and reopen. The Edge cache they use is shared with main Edge.
- For Windows Terminal apps using HTTPS: they typically use Windows’s DNS resolver, so Method 1 suffices. But Powershell’s
Invoke-WebRequestmay cache; restart the PowerShell session if needed.
Many users miss the browser-level cache. Flushing Windows alone is insufficient when the browser is the culprit.
Method 3: Bypass cache entirely for one lookup
For when you want to verify a domain’s current real IP without affecting your cache.
- Open Terminal. Run:
Resolve-DnsName example.com -Server 8.8.8.8 -NoHostsFileThis queries Google’s DNS directly, bypassing both Windows cache and your default DNS server’s cache.
- Compare with your local cache result:
Resolve-DnsName example.com. If different, your cache is stale or your DNS server has stale records. - For a quick browser test that bypasses caches: open Edge → Settings → Privacy → Use secure DNS. Enable, pick NextDNS or Cloudflare as resolver. Browser then uses DoH which has its own cache strategy.
- To permanently use a different DNS server: Settings → Network & internet → Wi-Fi → [your network] → DNS server assignment → Edit → Manual. Pick a DNS server (1.1.1.1 for Cloudflare, 8.8.8.8 for Google).
- For developers:
nslookup -type=A example.com 1.1.1.1queries Cloudflare directly without affecting your cache.
This is the diagnostic route — use it when troubleshooting DNS issues to compare cached vs. fresh results.
How to verify the fix worked
- Run
ipconfig /displaydns. Output should be empty immediately after flush. - Run
nslookup example.com. Result should show Non-authoritative answer (from your DNS server) with the current IP. - Try the affected website. Should load with the new content, no stale-cache redirect.
If none of these work
If DNS resolution remains stale after flushing, the cache is upstream of your PC. Router cache: many home routers cache DNS lookups themselves. Reboot the router or log in to its admin panel and look for a “flush DNS” option. ISP DNS: your ISP’s DNS server may have stale records. Bypass by setting your PC’s DNS to a public DNS (Cloudflare 1.1.1.1, Google 8.8.8.8, Quad9 9.9.9.9) via Settings → Network & internet → [adapter] → DNS server assignment. DNS-over-HTTPS bypass: if your network has a captive portal or transparent DNS proxy (common on corporate networks, public Wi-Fi), enable DoH in browser settings or in Windows’s DNS settings to bypass the network-level cache. For Hyper-V/WSL2 issues: the virtual switch has its own DNS resolution layer; restart HNSService service via services.msc. For VPN-connected PCs: the VPN client’s DNS server is used while VPN is up; disconnect VPN, flush, reconnect.
Bottom line: ipconfig /flushdns clears Windows’s DNS cache; browsers have their own caches at edge://net-internals/#dns. Flush both when DNS changes need to propagate to your PC.