View the DNS client cache on Windows

Inspect cached DNS records with Get-DnsClientCache before or instead of flushing.

WindowscacheDNStroubleshootingLow risk
Run `Get-DnsClientCache | Format-Table Entry, Data, TimeToLive -AutoSize` to see every cached domain name and the IP it resolves to.

01Command

Command
$ Get-DnsClientCache | Format-Table Entry, Data, TimeToLive -AutoSize

02What it does

Windows caches every DNS answer to speed up browsing, but a stale or poisoned cache entry can send you to the wrong server. Get-DnsClientCache lists each cached record, its data and remaining TimeToLive, so you can confirm whether a hostname is being answered from cache. If an entry is wrong, flush it with `ipconfig /flushdns` and resolve again.

03Risk

RiskLow risk

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Get-DnsClientCache
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: Retrieves the contents of the local DNS client cache, including entry names and record data.
  • netsh
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: Documents netsh WLAN commands including `netsh wlan show profile name=... key=clear` and `netsh wlan delete profile name=...`.

Last verified: 2026-09-18 · Category: Network

06Related solutions