Pcornel
Windows · DNS Client

DNS Client Cache

Cheat sheet · https://pcornel.dk/topic.php?topic=3090

Back to the Topic

Answer

The DNS client cache stores recent name lookups, including negative answers, for their TTL. View it with ipconfig /displaydns or Get-DnsClientCache and clear it with ipconfig /flushdns.

Remember

  • Failed lookups are cached as negative answers too.
  • ipconfig /flushdns clears the cache.
  • Each entry lives for its TTL.

First checks

  • Resolve-DnsName <name> — resolve via the Windows resolver
  • Get-DnsClientServerAddress — DNS servers per interface
  • Get-DnsClientCache — resolver cache
  • Get-DnsClientGlobalSetting — suffix search list
  • Clear-DnsClientCache — flush the cache

Commands

Get-DnsClientCache
Returns the DNS client cache entries as PowerShell objects that you can filter.
ipconfig /displaydns
Shows the entries in the local DNS client cache, including negative (failed) answers.
ipconfig /flushdns
Clears the local DNS client cache so the next lookup goes to the DNS server.
nslookup

Verify in this order

answer cached for TTL → used for repeat queries

Where it usually breaks

First mismatch in host/interface identity → local config/routing/name state → Windows service/provider → firewall/security/session → remote service → application-visible exchange; preserve identity/native error/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3090

Confirmation

Confirm action

Continue?