Windows DNS Cache: How It Works, View It & Flush It
The complete reference for Windows' system-wide DNS caching layer, the DNS Client service behind it, and the exact commands to inspect and clear it.
Windows maintains a single system-wide DNS cache shared by every application on the machine, managed by a background service most users never directly interact with. Understanding how it works — and the two commands that expose it — resolves a large share of "why isn't this working on my PC" DNS confusion.
ipconfig /displaydns before flushing, not just after — comparing the before-and-after output confirms the flush actually worked and shows you exactly what was cleared, which is far more useful during a genuine troubleshooting session than flushing blindly.ipconfig /flushdns and expecting a website's changes to appear for every visitor immediately. This command only clears your own machine's local cache — every other resolver on the internet, including your ISP's, is completely unaffected by it.- Introduction
- The Windows DNS Client Service
- Viewing the Cache: ipconfig /displaydns
- Reading the Output
- Flushing the Cache: ipconfig /flushdns
- Negative Caching on Windows
- DNS Client Service Configuration
- PowerShell Equivalents
- Smart Multi-Homed Name Resolution
- Windows Server vs Windows Client Differences
- Comparison Tables
- Enterprise & IT Team Considerations
- Common Mistakes
- Command Reference Checklist
- Expert Tips
- Daily Practical Use Cases
- Glossary
- FAQ
📝 Introduction
Windows resolves DNS queries through a single centralized service that every application on the system relies on, rather than each app maintaining its own separate cache. This centralization is convenient — one flush clears the cache for every browser, app, and background process at once — but it also means a single misbehaving cached entry can affect everything on the machine simultaneously until it's cleared.
⚙️ The Windows DNS Client Service
The DNS Client service (internally named Dnscache) is the Windows background service responsible for the entire local DNS caching mechanism. It intercepts DNS requests from every application, checks its own cache first, and only reaches out to the network-configured resolver on a cache miss. If this service is stopped or misconfigured, the caching behavior described throughout this guide — and the commands used to inspect and control it — won't function as expected.
🔍 Viewing the Cache: ipconfig /displaydns
Open Command Prompt and run ipconfig /displaydns to list every currently cached DNS record on the system, including the record name, type, and remaining time-to-live. This is the single most useful command for confirming exactly what Windows currently believes about a domain before you go further into troubleshooting.
📜 Reading the Output
Each entry in the displaydns output shows the record name, its record type, the time-to-live remaining in seconds, and the cached data itself — typically an IP address for an A or AAAA record. A record with a very low remaining TTL is about to be re-queried on its next lookup; a record showing "Negative" status indicates Windows has cached that the lookup previously failed, worth noting separately from a normal successful cache entry.
🗑️ Flushing the Cache: ipconfig /flushdns
Running ipconfig /flushdns clears every currently cached entry, forcing the next lookup for each domain to be resolved fresh from the network-configured resolver. This is the standard first step recommended in nearly every Windows DNS troubleshooting guide, and for good reason — it's fast, harmless, and immediately rules out a stale local cache as the cause of whatever issue is being investigated.
❌ Negative Caching on Windows
Windows caches failed DNS lookups just as it caches successful ones, which means a domain that briefly failed to resolve due to a misconfiguration elsewhere can continue appearing to fail locally for a period afterward, even once the underlying issue is fixed — running ipconfig /flushdns clears this negative cache entry alongside everything else, which is often the actual fix in this specific scenario.
🛠 DNS Client Service Configuration
Advanced users and system administrators can adjust DNS caching behavior through registry settings governing maximum cache entry TTL, negative cache TTL, and related parameters — changes generally reserved for specific troubleshooting or hardening scenarios rather than everyday use, since default Windows caching behavior is well-tuned for typical use cases.
💻 PowerShell Equivalents
PowerShell offers equivalent functionality through Get-DnsClientCache for viewing cached entries in a more structured, filterable format than the plain-text ipconfig output, and Clear-DnsClientCache for flushing — useful when scripting DNS diagnostics as part of a larger automated troubleshooting or monitoring routine.
⚖️ Smart Multi-Homed Name Resolution
Windows has a historical networking feature that queries DNS across every active network adapter simultaneously and accepts whichever response returns first, aimed at resilience on multi-interface systems but relevant to be aware of specifically in VPN contexts, where it can interact with DNS routing in ways that affect which resolver actually answers a given query — see our VPN DNS Leak guide for that specific scenario.
🖥️ Windows Server vs Windows Client Differences
Windows Server editions running the DNS Server role maintain a considerably more sophisticated caching and resolution architecture geared toward serving many clients at scale, distinct from the simpler local caching described in this guide for desktop Windows editions — administrators managing DNS infrastructure on Windows Server should consult Microsoft's server-specific documentation for cache configuration options beyond the scope of a single-machine client cache.
📊 Comparison Tables
| Command | Purpose |
|---|---|
| ipconfig /displaydns | View current DNS cache contents |
| ipconfig /flushdns | Clear the entire DNS cache |
| Get-DnsClientCache | PowerShell equivalent of displaydns |
| Clear-DnsClientCache | PowerShell equivalent of flushdns |
🏢 Enterprise & IT Team Considerations
IT teams supporting a fleet of Windows machines should include DNS cache flush as a standard early step in any DNS-related support ticket, ideally scriptable via PowerShell's Clear-DnsClientCache for remote or bulk execution across many machines simultaneously rather than requiring individual manual intervention on each device.
❌ Common Mistakes
✅ Command Reference Checklist
- Run ipconfig /displaydns first to see current state
- Run ipconfig /flushdns to clear the cache
- Re-run displaydns to confirm the flush worked
- Use PowerShell's Clear-DnsClientCache for remote/bulk operations
🎓 Expert Tips
💼 Daily Practical Use Cases
Support engineers use these commands as a first-line troubleshooting step for nearly any reported connectivity issue on a Windows machine. System administrators build DNS cache flushing into deployment scripts following infrastructure changes. Networking students use displaydns hands-on to see caching behavior concretely rather than only conceptually.
📚 Glossary
| Term | Definition |
|---|---|
| DNS Client Service (Dnscache) | The Windows background service managing local DNS caching |
| Negative Cache Entry | A cached record of a previously failed DNS lookup |
ToolsNovaHub tools are built and independently maintained with a focus on accurate, no-signup network and security utilities. Spotted an error? Let us know.
📋 Related Tools & Guides Comparison
| Resource | Type | Link |
|---|---|---|
| DNS Cache Checker | Tool | Open Tool → |
| Browser DNS Cache | Guide | Read Guide → |
| Linux DNS Cache | Guide | Read Guide → |
| macOS DNS Cache | Guide | Read Guide → |
| Flush DNS Commands | Guide | Read Guide → |