Guide

How to empty and test DNS cache on Windows

When the DNS has just been modified or a post keeps an old answer, emptying the local cache and comparing resolutions allows quickly to isolate the problem.

⌚ About 2 min read
View my favorites
Windows / DNS Beginner 5 min

When the DNS has just been modified or a post keeps an old answer, emptying the local cache and comparing resolutions allows quickly to isolate the problem.

Avant de commencer : adaptez toujours les commandes et manipulations à votre environnement. Sur un système de production, prévoyez une backup ou un retour arrière lorsque l’action peut modifier la configuration.

Étapes à suivre

  1. 1

    Show cache if necessary

    Find the relevant entries before deleting them if you need to understand what the position was using.

  2. 2

    Clear cache

    Run ipconfig /flushdns in a command prompt.

  3. 3

    Solve Name

    Use nslookup or Resolve-DnsName on the relevant FQDN.

  4. 4

    Compare DNS servers

    Check in ipconfig /all which solvers are actually used.

  5. 5

    Test Resource

    Check out the application after validation of the address obtained.

Commands utiles

ipconfig /displaydns
ipconfig /flushdns
ns Outlookup server.domain.local
Resolve-DnsName server.domain.local

À retenir

  • A DNS flush does not correct an erroneous DNS area.
  • The browser and some applications sometimes have their own cache.
  • Take into account the server-side TTL and intermediate solvers.
Technical deep dive

Windows DNS cache: what is actually cleared

Technical checkpoints

  • ipconfig /flushdns clears the local DNS Client cache; it does not clear a DNS server cache or an application/browser cache.
  • Get-DnsClientCache shows cached entries and their TTL.
  • Restarting Dnscache is more intrusive than a flush and is normally unnecessary just to invalidate an entry.

Before / after

Inspect the entry, clear the cache, then resolve the same name again using the same DNS server.

Get-DnsClientCache
ipconfig /flushdns
Resolve-DnsName example.com

Topic-specific pitfalls

  • Testing a different name after the flush does not prove the problematic entry changed.
  • A hosts file, NRPT, browser DoH or VPN can bypass the expected resolver.

How to validate

  • The name resolves to the expected address and the response source is identified.
  • TTL and cache behavior are consistent with the expected DNS change.
♡ 0