Why DNS Cache Causes Stale Resolution on Windows 11 and How to Flush It
🔍 WiseChecker

Why DNS Cache Causes Stale Resolution on Windows 11 and How to Flush It

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.

Symptom: Stale or wrong DNS resolution; website changes invisible to your PC; can’t connect to recently-recovered sites.
Affects: Windows 11 (and Windows 10) DNS Client service.
Fix time: ~2 minutes.

ADVERTISEMENT

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.

  1. Open Terminal (Admin): right-click Start → Terminal (Admin).
  2. Run:
    ipconfig /flushdns

    Output: Successfully flushed the DNS Resolver Cache.

  3. Verify cache is empty: ipconfig /displaydns. Should show no entries (or very few entries that have been re-queried since flush).
  4. Try the lookup that was stale: nslookup example.com. The result is queried fresh from your DNS server.
  5. For a one-line PowerShell equivalent: Clear-DnsClientCache. Same effect, doesn’t need admin in some configurations.
  6. Restart the DNS Client service for a stronger flush:
    net stop dnscache
    net start dnscache

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

ADVERTISEMENT

Method 2: Clear browser DNS cache separately

For when Windows cache flush doesn’t resolve and a browser is still stuck.

  1. In Edge: type edge://net-internals/#dns in address bar. Click Clear host cache.
  2. In Chrome: chrome://net-internals/#dns. Click Clear host cache.
  3. In Firefox: about:networking#dns. Click Clear DNS Cache.
  4. Also clear browser’s general cache: Ctrl + Shift + Delete → tick Cached images and files → click Clear.
  5. Close all browser windows fully and reopen. Some browsers don’t flush in-memory cache until restart.
  6. For Outlook/Teams (which use Edge WebView2 internally): close fully and reopen. The Edge cache they use is shared with main Edge.
  7. For Windows Terminal apps using HTTPS: they typically use Windows’s DNS resolver, so Method 1 suffices. But Powershell’s Invoke-WebRequest may 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.

  1. Open Terminal. Run:
    Resolve-DnsName example.com -Server 8.8.8.8 -NoHostsFile

    This queries Google’s DNS directly, bypassing both Windows cache and your default DNS server’s cache.

  2. Compare with your local cache result: Resolve-DnsName example.com. If different, your cache is stale or your DNS server has stale records.
  3. 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.
  4. To permanently use a different DNS server: Settings → Network & internet → Wi-Fi → [your network] → DNS server assignmentEdit → Manual. Pick a DNS server (1.1.1.1 for Cloudflare, 8.8.8.8 for Google).
  5. For developers: nslookup -type=A example.com 1.1.1.1 queries 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.

ADVERTISEMENT