sodcalculator

10 Tech How-To

How to Clear the Windows DNS Cache (Websites Not Loading)

Guide 10-9137 · Updated · Step by step

When websites suddenly fail to load, show a DNS error, or serve you an outdated version of a page, a corrupted or stale DNS cache is often the culprit. Clearing it forces Windows to re-query the domain name system from scratch, which resolves most connectivity hiccups in under a minute. This guide walks you through the exact command, plus what to do if the basic fix doesn’t work.

What You’ll Need

  • A Windows PC (Windows 10 or Windows 11)
  • Administrator access to open a Command Prompt or PowerShell as admin
  • Your internet connection can be active or inactive—the command works either way

Step-by-Step

  1. Open Command Prompt as Administrator. Click the Start button, type cmd (or Command Prompt), then right-click the result and choose Run as administrator. If prompted by User Account Control, click Yes.
  2. Run the DNS flush command. In the black window, type the following and press Enter:
    ipconfig /flushdns

    You should see the confirmation: Successfully flushed the DNS Resolver Cache.

  3. Verify the cache is empty (optional). To confirm, type ipconfig /displaydns and press Enter. A long list of entries means the cache still has data; an empty list (or just a header) means it’s clear.
  4. Close the Command Prompt and try loading the website again in your browser. If it still fails, continue to the next steps.
  5. Renew your IP address (if the flush didn’t help). In the same admin Command Prompt, run these two commands in order:
    ipconfig /release
    ipconfig /renew

    Wait a few seconds between them. This forces your PC to request a fresh IP from your router, which often clears network-level DNS issues.

  6. Reset the Winsock catalog (for stubborn cases). Type netsh winsock reset and press Enter. This resets network protocols to their default state. Restart your PC afterward.
  7. Restart your router/modem. Unplug it for 30 seconds, plug it back in, and wait for the lights to stabilize. This clears any DNS issues on the network side.

Common Mistakes

  • Not running as administrator. The ipconfig /flushdns command will fail with an “Access deniedâ€� error if you don’t have admin rights. Always right-click and choose “Run as administratorâ€�.
  • Typing the command incorrectly. Common typos include ipconfig /flush or ipconfig /flushdns with a space before the slash. The exact syntax is ipconfig /flushdns (no space before the slash).
  • Flushing the cache but not restarting the browser. Your browser may keep its own DNS cache. Close all browser windows completely, or restart the browser after flushing.
  • Ignoring browser-specific caches. Chrome, Firefox, and Edge each have their own internal DNS cache. Even after a Windows flush, a browser may still hold a stale entry. Clear the browser’s cache or restart it.

Tips

  • Use PowerShell if you prefer. The same command works in Windows PowerShell (also run as admin). Type ipconfig /flushdns and press Enter.
  • Flush after changing DNS servers. If you switch from your ISP’s DNS to a public one like Google (8.8.8.8) or Cloudflare (1.1.1.1), flush the cache to avoid old entries lingering.
  • Create a desktop shortcut. Right-click your desktop, choose New > Shortcut, and paste ipconfig /flushdns as the location. Name it “Flush DNSâ€�. When you run it, it will flash a window and close. To keep it open, use cmd /k ipconfig /flushdns.
  • Check your hosts file. If a specific site still won’t load, a manual entry in the hosts file (C:\Windows\System32\drivers\etc\hosts) could be overriding DNS. Open it in Notepad as admin and look for lines that aren’t commented out (starting with #).

Troubleshooting

If you’ve flushed the cache and the site still won’t load, work through these in order:

  1. Check if the site is down for everyone. Use a service like downforeveryoneorjustme.com (or a similar uptime checker) to see if the site itself is offline. If it’s down, your cache isn’t the problem.
  2. Try a different browser or device. If the site loads on your phone but not your PC, the issue is local. If it fails on both, it’s likely a network or DNS server problem.
  3. Flush and re-register DNS. Run these commands in order, waiting a few seconds between each:
    ipconfig /flushdns
    ipconfig /registerdns
    ipconfig /release
    ipconfig /renew
    netsh winsock reset

    Then restart your PC.

  4. Change your DNS server. If your ISP’s DNS is unreliable, switch to a public one. Go to Control Panel > Network and Internet > Network Connections, right-click your active connection, select Properties, select “Internet Protocol Version 4 (TCP/IPv4)â€�, click Properties, and choose “Use the following DNS server addressesâ€�. Enter 8.8.8.8 and 8.8.4.4 (Google) or 1.1.1.1 and 1.0.0.1 (Cloudflare). Click OK and flush the cache again.
  5. Disable IPv6 temporarily. Some networks have broken IPv6 configurations. In the same network properties window, uncheck “Internet Protocol Version 6 (TCP/IPv6)� and click OK. Reboot and test.
  6. Run Windows Network Diagnostics. Right-click the network icon in the system tray and select “Troubleshoot problems�. Windows will scan and often fix common issues automatically.

Frequently Asked Questions

How often should I flush the DNS cache?

Only when you encounter DNS-related problems, such as websites not loading or resolving to wrong IPs. There’s no need to flush on a schedule—doing it too often can actually slow down your browsing slightly because your PC has to re-resolve every domain.

Will flushing DNS log me out of websites?

No. DNS cache is separate from cookies, sessions, or login tokens. You’ll stay logged in to any sites you’ve already authenticated with.

Does the DNS cache clear automatically?

Yes. Windows stores DNS entries for a limited time (typically a few minutes to a few hours, based on the TTL set by the domain). It automatically removes old entries, but sometimes a stale entry persists longer than it should, which is why manual flushing is useful.

Why does the command say “Access denied�?

You didn’t run the Command Prompt as administrator. Right-click the Command Prompt icon and select “Run as administratorâ€�, then try again.

Can I clear the DNS cache without Command Prompt?

Yes, you can restart your PC or disable/re-enable your network adapter, but the command prompt method is the quickest and most reliable. There’s no built-in GUI button for it.

What’s the difference between DNS cache and browser cache?

DNS cache stores IP addresses for domain names (so your PC knows where to send requests). Browser cache stores files like images, CSS, and JavaScript so pages load faster on repeat visits. Clearing browser cache won’t fix DNS issues, and vice versa.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →