Pcornel
Browse topics
Options
Recent
Favorites
Windows · Technical reference

DNS Client Cache

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

When to use this

Use this when stale DNS answers are cached on a client.

First 30 seconds

1. Get-DnsClientCache | ? Entry -like '*<name>*'.

2. Stale entry → Clear-DnsClientCache / ipconfig /flushdns.

3. Negative caching after a failure.

4. TTL decides lifetime.

5. Retest.

Operational verification

answer cached for TTL → used for repeat queries

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Windows networking and network services
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformWindows networking and network services · Windows / Windows Server / PowerShell
Key commandGet-DnsClientCache
Scope / prerequisiteUse this when stale DNS answers are cached on a client.
Verify · 1Reference · 2
What next?3 suggested next steps
Catalog command links3
Evidence1
On this pageJump to a specific section
Windows command reference

Primary Commands

Configuration and operational commands for this Topic.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Common mistakes Narrow the fault
  • Testing a DNS change without flushing the cache.
  • Forgetting browser caches (Chrome chrome://net-internals/#dns).
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Failed lookups are cached as negative answers too.
  • ipconfig /flushdns clears the cache.
  • Each entry lives for its TTL.
Key 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
ReferenceWhy it matters1 section · depth on demand

How it works

The DNS client cache holds answers for their TTL (capped by MaxCacheTtl, default one day). Entries from the hosts file are loaded into the cache too and do not expire. Applications using the Windows resolver share this cache; some (browsers, Java) keep their own.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

Reading the cache

PS C:\> Get-DnsClientCache -Entry app.corp.example.com
Entry                 RecordName            Record Status    Section TimeTo Data   Data
                                            Type                     Live   Length
-----                 ----------            ------ ------    ------- ------ ------ ----
app.corp.example.com  app.corp.example.com  A      Success   Answer   212    4     10.20.0.15
PS C:\> Get-DnsClientCache | Where Status -ne Success
ColumnMeaning
Status SuccessPositive answer cached
Status NotExist / NoRecordsNegative answer cached — the name will keep failing until it expires
TimeToLiveSeconds left; counts down from the record TTL (capped by MaxCacheTtl)
SectionAnswer, or Additional for glue

Negative caching is the usual "it still fails after the fix"

If a client looked up a name before the record existed, it caches the failure. After creating the record, run Clear-DnsClientCache on the client (or wait). Server-side caches on the resolver also need clearing: Clear-DnsServerCache on the Windows DNS server answering the client.

Hosts file entries

Entries from C:\Windows\System32\drivers\etc\hosts are preloaded into the cache with a very long TTL and survive a flush (they are reloaded). Resolve-DnsName name -NoHostsFile bypasses them; an unexpected answer that only appears with the hosts file points to a stale hosts entry — often added during a migration and forgotten.

Who uses the cache

Resolver pathUses Windows DNS client cache?
Applications calling the Windows resolver (most)Yes
Resolve-DnsNameYes (-DnsOnly/-NoHostsFile alter sources)
nslookupNo — sends queries itself, ignores cache and hosts file
Browsers with their own DNS (DoH)No — own cache

This explains why nslookup shows the new address while the application still connects to the old one.

Registry tuning

MaxCacheTtl and MaxNegativeCacheTtl under HKLM\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters cap cache lifetimes; lowering the negative cache is common on hosts that depend on dynamically registered names.

*The DNS client cache records above are illustrative examples, not captured from a lab or production system.*

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docWindows networking and network services current

Authoritative/upstream documentation reviewed for bounded claims in DNS Client → DNS Client Cache. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://learn.microsoft.com/en-us/windows-server/networking/dns/dns-client-settings · confidence 94%
Confirmation

Confirm action

Continue?