For our Blog Visitor only Get Additional 3 Month Free + 10% OFF on TriAnnual Plan YSBLOG10
Grab the Deal

Ipconfig /displaydns Command Explained in 2026

ipconfig /displaydns is a Windows command that shows the current contents of the DNS Resolver Cache. It lists recently resolved domain names, their record types (A, AAAA, CNAME), time to live (TTL), and destination IPs.

Use it to troubleshoot DNS issues, verify record changes, and understand how Windows resolves domains without re-querying DNS servers. If you manage websites, hosting, or simply browse the web, understanding the ipconfig /displaydns command can save hours of DNS troubleshooting.

This guide explains what it does, how it works behind the scenes, how to read its output, and practical ways to use it during site migrations, SSL issues, and connectivity problems.


What is ipconfig /displaydns?

ipconfig /displaydns displays Windows’ DNS Resolver Cache the local memory of recent DNS lookups your system has performed.

Ipconfig /displaydns Command

Instead of querying a DNS server every time you visit a domain, Windows caches answers for a period defined by each record’s TTL.

Viewing this cache helps you see exactly which domain names your device has resolved and where they pointed.

How Windows DNS Caching Works

When you access a domain (like example.com), Windows checks the local cache first. If a valid answer exists (not expired), it’s used immediately faster and lighter than querying the network.

If not, Windows asks the configured DNS resolver (often your ISP, a public resolver like 1.1.1.1/8.8.8.8, or a corporate DNS). The new answer is then stored locally until its TTL expires.

ipconfig /displaydns reveals those cached entries. That visibility is crucial when you change DNS records (A, AAAA, CNAME) and need to confirm whether your machine still holds an old IP address.

When to Use ipconfig /displaydns

Use the command when:

  • You changed DNS records (e.g., after a web host migration) and still reach the old server.
  • You suspect DNS hijacking, poisoning, or stale entries causing redirects.
  • A site loads on some devices but not others, suggesting inconsistent caching.
  • You want to confirm which hostnames your system recently resolved, for auditing or troubleshooting.

How to Run ipconfig /displaydns (Windows 10/11)

Using Command Prompt

You don’t need admin rights to view the cache.

1) Press Win + R, type cmd, and press Enter.
2) Run:
   ipconfig /displaydns
3) Scroll or pipe the output:
   ipconfig /displaydns | more
4) Export to a file:
   ipconfig /displaydns > dns-cache.txt

PowerShell Equivalent

PowerShell offers structured output that’s easier to filter.

# View cache
Get-DnsClientCache

# Filter by domain
Get-DnsClientCache | Where-Object {$_.Entry -like "*example.com*"}

# Export to CSV for analysis
Get-DnsClientCache | Export-Csv -Path .\dns-cache.csv -NoTypeInformation

Understanding the Output

A typical ipconfig /displaydns entry looks like this:

example.com
    ----------------------------------------
    Record Name . . . . : example.com
    Record Type . . . . : 1
    Time To Live  . . . : 283
    Data Length . . . . : 4
    Section . . . . . . : Answer
    A (Host) Record . . : 93.184.216.34

Key fields you’ll see:

  • Record Name: The queried domain or subdomain.
  • Record Type: 1 = A, 28 = AAAA, 5 = CNAME, among others.
  • Time To Live (TTL): Seconds remaining before the entry expires.
  • Section: Typically Answer; may show Additional or Authority sections for certain responses.
  • Data: The IP (A/AAAA), canonical name (CNAME), or other record data.

If you see a CNAME followed by an A/AAAA record, Windows resolved the alias first, then the final IP. Multiple A/AAAA records indicate load balancing or multi homing.

Real World Troubleshooting Scenarios

1) Website Migration Still Points to Old IP

Symptom: After moving hosting, your domain resolves to the previous server.

  • Run ipconfig /displaydns and find your domain; check the IP.
  • If old, clear cache with ipconfig /flushdns (see below).
  • Test again. If still old, your network or browser may also cache; try another device or DNS server.

2) SSL/TLS Errors After DNS Change

Symptom: Browser shows certificate mismatch.

  • Use ipconfig /displaydns to confirm the domain resolves to the new server.
  • Ensure the new server hosts the correct certificate for the hostname.
  • Flush DNS cache and hard refresh the browser (Ctrl+F5).

3) Intermittent Timeouts

Symptom: Some requests time out while others work.

  • Check if multiple IPs are cached for the same hostname.
  • Ping or test each IP with tracert to find packet loss.
  • If one IP path is bad, wait for TTL expiry or switch resolvers temporarily.

4) Hosts File vs DNS Cache

If you’re overriding DNS using C:\Windows\System32\drivers\etc\hosts, the hosts entry is typically consulted before querying DNS. But stale cache entries can confuse testing. Clear the cache after editing hosts to ensure the override is used.


Filtering, Searching, and Exporting the DNS Cache

Because ipconfig outputs text, use common shell techniques to filter and save results.

# Command Prompt: find entries related to a domain
ipconfig /displaydns | findstr /i "example.com"

# Save everything for audit
ipconfig /displaydns > C:\Temp\dns-cache.txt

# PowerShell: filter and save in structured format
Get-DnsClientCache | Where-Object {$_.Entry -like "*example.com*"} | 
    Select-Object Entry, RecordType, TimeToLive, Data | 
    Export-Csv .\example-dns.csv -NoTypeInformation

How to Clear and Refresh the DNS Cache

When cached answers are outdated, flush them.

# Command Prompt (run as Administrator for best results)
ipconfig /flushdns

# PowerShell alternative
Clear-DnsClientCache

After flushing, Windows will re-query your configured DNS resolver. If you still receive old data, the resolver itself may be caching. Try switching temporarily to another DNS server (e.g., 1.1.1.1 or 8.8.8.8), or wait for upstream TTLs to expire.


Advanced Tips and Limitations

DNS Client Service Must Be Running

Windows stores the resolver cache under the DNS Client (Dnscache) service. If this service is stopped or disabled, you may not see entries or be able to flush.

# Check and restart the DNS Client service (Admin)
sc query Dnscache
net stop Dnscache
net start Dnscache

Apps That Bypass the OS Resolver

Some applications may use their own DNS logic or encrypted DNS directly (e.g., browser specific DoH configurations), meaning not every lookup appears in the OS cache. ipconfig /displaydns shows what Windows resolved, not necessarily what every app resolved independently.

Not a DNS Server Cache

This is a per-device cache, separate from your network’s DNS server cache. Entries and TTLs may differ from what other devices see. For network wide issues, check the resolver DNS server or your router’s DNS settings.

Privacy Considerations

The resolver cache can reveal recent domains you visited. Before sharing logs, review and redact sensitive hostnames.


Scripting and Automation for IT Pros

For fleet diagnostics or incident response, PowerShell gives you consistent, parseable data.

# Snapshot DNS cache on multiple machines (PsExec/WinRM context)
$stamp = Get-Date -Format "yyyyMMdd-HHmmss"
Get-DnsClientCache | 
  Select-Object Entry, RecordType, TimeToLive, Data | 
  Export-Csv ".\dns-cache-$stamp.csv" -NoTypeInformation

# Clear then verify
Clear-DnsClientCache
Start-Sleep -Seconds 2
Get-DnsClientCache | Measure-Object

Combine this with network tests (Test NetConnection, Resolve DnsName) for end to end validation after DNS changes.

Common Errors and Fixes

  • Error: “Could not flush the DNS Resolver Cache: Function failed during execution.” – The DNS Client service may be stopped or restricted. Restart it with net start Dnscache (Admin).
  • No entries shown – Recently booted system, DNS client disabled, or all entries expired. Browse a few sites and run the command again.
  • Entries reappear after flush – An app or service is performing lookups in the background. After flushing, those apps may immediately repopulate the cache.

Website Owners: Faster, Safer DNS Changes

During migrations or CDN cutovers, lower your DNS TTL 24-48 hours before changes, then raise it after. Use ipconfig /displaydns to confirm your device sees the new records. If you host with YouStable, our support team can help plan TTLs, validate records, and minimize downtime during moves especially for high traffic or ecommerce sites.

When testing pre-launch, add a hosts file entry pointing to the new server and flush DNS. This lets you verify the site (and SSL) on the new IP without exposing it publicly. YouStable’s engineers can guide you through this workflow step by step.

  • ipconfig /flushdns: Clears the local resolver cache.
  • nslookup example.com: Queries a DNS server directly (basic testing).
  • Resolve DnsName example.com (PowerShell): Modern resolver with detailed output.
  • Get DnsClientServerAddress: Shows which DNS servers your adapters use.
  • tracert or Test NetConnection: Verifies network path and connectivity.

FAQ’s

1. Does ipconfig /displaydns show all DNS queries from my PC?

No. It shows entries cached by Windows’ DNS Client. Apps that use their own resolvers or encrypted DNS may bypass the OS cache, so their lookups might not appear here.

2. How long do entries stay in the DNS cache?

Each record includes a TTL (in seconds) set by the domain’s DNS. Windows counts down that TTL; when it reaches zero, the entry expires and is removed or refreshed on the next lookup.

3. Is ipconfig /flushdns enough to see new DNS changes immediately?

It clears your local cache, but upstream resolvers (ISP/public) may still serve old data until their cache TTL expires. If urgent, switch to another DNS server temporarily or wait for propagation.

4. Why do I see both CNAME and A/AAAA records for the same name?

A CNAME is an alias pointing to another hostname. Windows resolves the CNAME target and then caches the final A/AAAA record(s), so you’ll often see both as part of a single resolution chain.

5. What’s the PowerShell command for viewing the DNS cache?

Use Get DnsClientCache. It provides structured output ideal for filtering and exporting. To clear the cache in PowerShell, use Clear DnsClientCache.
Mastering ipconfig /displaydns gives you clear visibility into DNS behavior on Windows. Whether you’re diagnosing a stubborn redirect, validating a migration, or auditing recent lookups, this command and its PowerShell counterparts belong in your everyday toolkit. And if you want expert help aligning DNS with hosting performance, YouStable is here to assist.

Sanjeet Chauhan

Sanjeet Chauhan is a blogger & SEO expert, dedicated to helping websites grow organically. He shares practical strategies, actionable tips, and insights to boost traffic, improve rankings, & maximize online presence.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top