Use ipconfig /flushdns first. It is the fastest, cleanest way to clear the Windows DNS resolver cache without interrupting the DNS Client service. Microsoft describes /flushdns as the command that “flushes and resets the contents of the DNS client resolver cache” [source: Microsoft]. Restarting the DNS Client service can work too, but it is heavier, needs admin rights, and may be blocked or greyed out on some Windows systems.
TLDR: If a website moved servers, a VPN changed DNS settings, or a local hostname points to the wrong place, run ipconfig /flushdns before trying anything else. In a typical office support case, this can fix stale DNS lookups in under 10 seconds instead of spending 5 to 15 minutes rebooting or changing network settings. Example: if intranet.company.local still opens the old server after a migration, flushing DNS forces Windows to ask for a fresh address. Restart the DNS Client service only when the cache seems stuck, DNS behavior is odd across many apps, or troubleshooting requires a full service refresh.
What DNS flushing actually does
DNS turns names into IP addresses. You type example.com, and Windows asks a DNS resolver where that site lives. To avoid asking the same question again and again, Windows stores answers in a local cache.
That cache is useful. It makes repeat lookups faster. It also reduces network chatter. The annoying part is that bad answers can stay around for a while. If a site changes IP addresses, a VPN pushes new DNS servers, or a developer edits a local DNS entry, Windows may keep using the old answer until the record expires.
That is when flushing DNS helps. It clears stored DNS answers, so Windows has to request fresh ones. It does not erase browser history. It does not reset your router. It does not fix every internet problem. It only clears the local DNS resolver cache on that Windows machine.
Image not found in postmetaThe quick method: ipconfig /flushdns
The standard command is simple:
ipconfig /flushdns
To use it:
- Press Windows and type cmd.
- Open Command Prompt. If needed, choose Run as administrator.
- Type
ipconfig /flushdns. - Press Enter.
If it works, you should see:
Successfully flushed the DNS Resolver Cache.
That message means Windows cleared its local DNS cache. The next time an app asks for a domain, Windows checks again instead of reusing the old cached answer.
This is the option most people should use. It is fast. It is low risk. It does not stop a Windows service. It usually takes less than a second after the command runs.
When ipconfig /flushdns is enough
Use ipconfig /flushdns when you have a clear DNS caching problem. Common cases include:
- A website moved to a new server, but your PC still opens the old one.
- A VPN was connected or disconnected, and internal domains now fail.
- A local development site changed, but the browser keeps hitting the wrong address.
- A domain was recently created, and Windows keeps saying it cannot be found.
- You changed DNS servers, such as switching from ISP DNS to Cloudflare or Google DNS.
Honestly, it feels like DNS waits until you are already irritated before showing stale results. One tab works. Another fails. A coworker can open the site, but your machine refuses. In that situation, flushing DNS is the least painful first step.
The heavier method: restarting the DNS Client service
Windows also runs a service called DNS Client, with the service name Dnscache. This service caches DNS names and helps with name registration. Since the cache lives inside that service, restarting it can clear DNS state as a side effect.
You may see advice to restart it with commands like:
net stop dnscache
net start dnscache
Or with PowerShell:
Restart-Service Dnscache
In practice, this is not always smooth. On many Windows 10 and Windows 11 machines, the DNS Client service cannot be stopped from the Services window. The buttons may be greyed out. Some command attempts fail unless the shell is elevated. Some are blocked by service protection or system policy. Expect to waste time on this if you only needed a normal DNS cache clear.
ipconfig /flushdns vs restarting DNS Client
Here is the practical difference:
| Method | Best for | Risk level | Admin needed? |
|---|---|---|---|
ipconfig /flushdns |
Clearing stale DNS cache quickly | Low | Usually no, but admin can help in locked environments |
| Restart DNS Client service | Deeper DNS Client troubleshooting | Medium | Yes |
ipconfig /flushdns is a precise tool. It clears the resolver cache and leaves the service running. That is ideal for routine fixes.
Restarting the DNS Client service is broader. It stops and starts the component that handles caching. That may disrupt name resolution for a moment. On a personal laptop, that interruption may not matter. On a work machine running VPN software, endpoint security, mapped drives, or remote tools, even a short DNS pause can be annoying.
How to inspect the cache before flushing
If you want to see cached DNS entries before clearing them, run:
ipconfig /displaydns
This can produce a long list. Some entries are normal web domains. Others come from Microsoft services, browser activity, internal tools, or background apps. Do not panic if it looks messy. Windows and modern apps ask for a lot of names.
After flushing, run the same command again. You should see far fewer entries, though the cache may refill quickly as apps continue working in the background.
Common mistake: confusing DNS cache with browser cache
DNS cache and browser cache are not the same thing.
- DNS cache stores domain to IP address answers.
- Browser cache stores page files, images, scripts, and cookies.
If a website opens the wrong server, flush DNS. If a site loads old images or broken styling, clear the browser cache. If login behavior is strange, cookies may be involved. It drives me crazy that all three get blamed on “cache,” but they solve different problems.
What if flushing DNS does not work?
If ipconfig /flushdns succeeds but the problem stays, try these steps in order:
- Close and reopen the browser. Some browsers keep their own DNS or connection state.
- Test another browser. This separates Windows DNS issues from browser issues.
- Disconnect and reconnect VPN. VPN clients often push private DNS settings.
- Check your DNS server settings. Wrong DNS servers can return wrong answers.
- Restart the PC. It is blunt, but it resets more than DNS.
- Restart the router if every device on the network has the same issue.
For a more targeted check, use:
nslookup example.com
This shows which DNS server answered and what IP address it returned. If nslookup returns the old IP, the issue may be upstream. Your local flush worked, but the DNS server itself may still have old data.
When restarting DNS Client makes sense
Restart the DNS Client service only after simpler steps fail. It can be useful when:
- DNS lookups behave inconsistently across many apps.
- The cache appears to refill with bad entries right away.
- A system policy or security tool changed DNS behavior.
- You are troubleshooting with an IT admin and need a full service refresh.
If you try it, open Terminal, Command Prompt, or PowerShell as administrator. If Windows refuses to stop the service, do not force random registry edits from old forum posts. A reboot is often safer and faster.
The best rule of thumb
Use ipconfig /flushdns for nearly every normal DNS cache problem. It is quick, safe, and built for this exact job. Use DNS Client service restart only for stubborn cases or admin-level troubleshooting.
The smart order is simple: flush DNS, retest, check the browser, check VPN, then consider deeper service work. Most of the time, the first command is all you need.

