Flushing the DNS Cache on Windows
What the Windows DNS client cache stores, how to view and clear it with ipconfig /flushdns, and which caches a flush does not reach.
A name that resolved correctly yesterday stops resolving today, and the first thing most troubleshooting lists suggest is to flush the DNS cache. That advice is correct often enough to be worth keeping, but only if the reader knows what the cache holds and what clearing it actually changes. The Windows DNS client cache stores two kinds of entries: successful answers, mapping a hostname to an address, and negative answers, recording that a lookup failed. A flush removes both. It does not touch the resolver cache inside a browser, the cache on a home router, or anything held by the ISP’s recursive resolver, and it does not change which server the machine asks in the first place.
What the DNS client cache holds and why it exists
Every time an application asks Windows to resolve a name, the DNS Client service (Dnscache) checks its local cache before sending a query anywhere. If an entry is present and has not expired, the answer is returned from memory. This is the point of the cache: a page load that references a dozen hostnames should not generate a dozen network round trips each time.
Entries carry a time to live, taken from the record the server returned. Positive entries expire when that TTL runs out. Negative entries also have a lifetime, which is why a hostname that did not exist ten minutes ago may resolve now without any intervention. The cache is per-machine and per-user-session in effect; it is not shared with other devices on the network.
A cached answer becomes wrong when the authoritative record changes and the local copy has not yet expired. A cached negative answer becomes wrong when a record is created for a name that previously did not exist. Both situations produce the same symptom from the user’s side: the name does not work on this machine but works elsewhere.
Viewing the cache before clearing it
Reading the cache first tells you whether the problem is a stale entry at all. If the name is absent from the cache, flushing cannot help, and the fault lies further along the resolution path.
ipconfig /displaydns
The output lists each cached record with its name, type, TTL and data, followed by the records section and then any negative entries. A name that appears with an address you did not expect is a stale positive entry. A name that appears under the negative cache with a short TTL is a cached failure. A name that does not appear at all was never cached, or has already expired, and the query is going out to a server each time.
For a narrower view, the DNS client cmdlets return the same information in object form, which is easier to filter. Get-DnsClientCache lists entries, and its output can be filtered by entry, record type or status.
Clearing the cache
The classic command is run from an elevated or ordinary command prompt; it does not require administrator rights on a standard configuration.
ipconfig /flushdns
Success prints a single line confirming the DNS resolver cache was flushed. No list of removed entries is shown, so the confirmation is the only output. The PowerShell equivalent is Clear-DnsClientCache, which produces no output on success and is the form to use inside a script.
Neither command affects anything outside the local DNS client cache. Connections already established are not torn down, and applications holding their own resolved addresses are unaffected until they resolve again.
When a flush actually fixes the symptom
A flush is the right action in a narrow set of cases, and recognising them saves time spent on commands that cannot help.
| Situation | Flush helps | How to confirm first |
|---|---|---|
| A record was changed at the provider and the old address is still in use | Yes | ipconfig /displaydns shows the old address with time left on its TTL |
| A name failed to resolve earlier and now exists | Yes, if the failure is still cached | The name appears in the negative cache section |
| The machine has no address, no gateway, or no route | No | ipconfig shows no valid lease or an address in the 169.254 range |
| Only one browser fails while other applications resolve the name | No | The failure follows the browser, not the machine |
| Every device on the network fails for the same name | No | A second device on the same connection shows the same failure |
| The name resolves but the connection is refused or times out | No | Resolution succeeds; the failure is at the transport layer |
The last three rows account for most cases where a flush is tried and does nothing. When resolution succeeds but the connection does not, the fault is routing, NAT or a firewall, not name resolution. The connectivity section explains how to trace that path: see how DNS resolution works for the full sequence from stub resolver to authoritative server, including where a stale answer can be introduced at each step.
Caches a flush does not reach
Three other caches sit between the user and the authoritative record, and none of them are cleared by ipconfig /flushdns.
Browsers keep their own DNS cache, separate from the operating system’s, with their own expiry behaviour. A browser that has pinned an address will keep using it after the system cache is cleared. Each browser has an internal page for clearing it; the address differs by browser and is documented by the browser’s own vendor. Restarting the browser is the reliable way to force it to resolve again.
The router on a home or small-office connection runs a DNS forwarder with its own cache. When the router holds a stale answer, every device behind it sees the same wrong result, and clearing the cache on one PC changes nothing. The router’s administrative interface may offer a way to clear or restart the forwarder; if the ISP supplied the router and has not given administrative access, that step belongs to the ISP and cannot be performed from the machine.
The recursive resolver operated by the ISP or a public DNS provider also caches answers according to TTL. Nothing on the local machine can clear it. If the record was changed recently and the resolver has not yet expired its copy, the old answer persists until the TTL runs out. The only local lever is to point the machine at a different resolver, which changes who is asked rather than clearing anyone’s cache.
/release and /renew are DHCP, not DNS
A frequent pairing in troubleshooting lists is to run /release, then /renew, then /flushdns. The first two commands have nothing to do with name resolution. They surrender and re-request the machine’s IP address lease from a DHCP server.
ipconfig /release
ipconfig /renew
/release gives up the current lease, and the machine loses its address until /renew obtains a new one. Running them is appropriate when the address itself is wrong: an address in the 169.254 range, which Windows assigns when no DHCP server answered, or an address from the wrong subnet. It is not appropriate as a routine companion to a DNS flush, and on a connection that is working it briefly interrupts connectivity for no benefit.
If the address is correct and the gateway is reachable, the lease is not the problem and neither command will change the outcome.
What to check when the flush changes nothing
If the cache was cleared and the name still fails, the next question is whether the query leaves the machine and what comes back. nslookup queries a DNS server directly and bypasses the client cache, so it separates a cache problem from a resolution problem.
nslookup example.com
The output names the server that answered and returns the address or an error. A response from the configured server that matches what the application sees means the client cache is not involved. A timeout means the query is not reaching a server, which points at the network path rather than at DNS. A response that differs from what the application reports points back at a cache somewhere between them.
Confirm which servers the machine is configured to use before drawing conclusions from the answer.
ipconfig /all
The output lists the DNS servers per adapter alongside the address, gateway and lease information. A machine with no DNS server listed, or with a server on an unreachable subnet, will fail every lookup regardless of cache state. A machine with a valid configuration that still fails is a routing or filtering question, and the connectivity material covers how to follow it.
Where the fix stops being local
Some failures cannot be resolved from the machine, and recognising them prevents a long sequence of commands that were never going to work. If every device on the connection fails for the same name, the stale answer is held by the router or the ISP resolver. If the router was supplied by the ISP and administrative access is not available, clearing its cache is the ISP’s action. If a name resolves to an address that is unreachable from this network while reachable from elsewhere, the difference is in routing or in the provider’s network, not in the local cache.
A flush is a one-line action with a clear scope: it removes the machine’s own stored answers and failures. When the symptom survives it, the evidence points somewhere the command cannot reach, and the next step is to find out which of those places is holding the wrong answer.
Common questions
Does ipconfig /flushdns fix slow internet?
No. It clears stored name resolution answers on one machine. Slowness in transferring data, high latency or low throughput is a routing, congestion or link quality issue, and no DNS cache entry affects it. The command only changes which address a name resolves to, not how fast traffic moves once connected.
Why does the site still load the old version after I flush DNS?
The browser keeps its own DNS cache and may also hold the page itself in its HTTP cache. Flushing the Windows client cache does not clear either. Restarting the browser forces it to resolve the name again, and a private or incognito window bypasses the stored page copy for a single test.
Do I need to run ipconfig /release and /renew with a DNS flush?
No. Those two commands manage the DHCP address lease and have no effect on name resolution. They are useful when the machine holds a wrong or self-assigned address, such as one in the 169.254 range, but running them on a working connection only interrupts it briefly.
How do I clear the DNS cache on the router?
It depends on the router model. Many administrative interfaces offer a reboot or a cache clear option; a reboot usually empties the forwarder cache. If the ISP supplied the equipment and did not provide administrative access, that step has to be requested from the ISP.
Does flushing DNS delete saved passwords or browsing history?
No. The command removes only the stored hostname-to-address mappings and cached lookup failures held by the Windows DNS Client service. Browsing history, cookies, saved credentials and downloaded files are stored elsewhere and are not touched.
Read next
- ERR_CONNECTION_RESET: Tracing a TCP Reset on Windows ERR_CONNECTION_RESET means something on the path or the server sent a TCP RST. How to separate security software, proxy, MTU, filtering and server causes.
- Resetting Winsock and the Windows Network Stack What netsh winsock reset and netsh int ip reset actually rewrite, when a broken layered provider is the cause, and when the reset is the wrong tool.
- No Internet Access and Unidentified Network in Windows Why Windows shows no internet access or unidentified network, how the NCSI probe works, and how to trace the fault from adapter address to gateway, DNS, and carrier.
- ARP and MAC Addresses: Finding the Hardware How a host finds the MAC behind an IP, why ARP never leaves the local network, and how a stale cache entry produces a confusing partial outage.
- DNS Scavenging: Why Stale Records Vanish Understand DNS scavenging: how aging and scavenging remove stale records, why records disappear, and how to configure it safely.