Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Clear DNS Cache on Windows PC: 4 Ways

· 5 min read · Home Networking

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Clearing the DNS cache on a Windows PC forces your computer to re-query the Domain Name System (DNS) for fresh IP addresses, which often fixes problems like websites not loading, showing old content, or giving "server not found" errors. The most common method is using the ipconfig /flushdns command in Command Prompt, but there are also alternatives via PowerShell, Windows Terminal, or restarting the DNS Client service. No special tools or admin rights are needed beyond being able to open a command prompt as administrator.

What You'll Need

  • A Windows PC (Windows 10 or Windows 11; steps are similar on older versions).
  • Administrator access to your PC (you'll need to confirm a User Account Control prompt).

Step-by-Step

Method 1: Using Command Prompt (Fastest)

  1. Press Windows + R to open the Run dialog.
  2. Type cmd and press Ctrl + Shift + Enter to run Command Prompt as administrator. (If prompted by User Account Control, click Yes.)
  3. In the Command Prompt window, type the following command and press Enter:
  4. ipconfig /flushdns
  5. You should see the message: Windows IP Configuration Successfully flushed the DNS Resolver Cache.
  6. Close the Command Prompt window. The cache is now cleared.

Method 2: Using PowerShell (Alternative)

  1. Press Windows + X and select Windows PowerShell (Admin) or Terminal (Admin) from the menu.
  2. If prompted, click Yes to allow changes.
  3. Type the following command and press Enter:
  4. Clear-DnsClientCache
  5. No confirmation message appears, but the cache is cleared. You can verify by running ipconfig /displaydns to see an empty list.

Method 3: Using Windows Terminal (Windows 11 / Windows 10 22H2+)

  1. Right-click the Start button and select Terminal (Admin).
  2. If the terminal opens to PowerShell, you can use the same Clear-DnsClientCache command.
  3. If it opens to Command Prompt, use ipconfig /flushdns.
  4. Press Enter and wait for the confirmation message.

Method 4: Restart the DNS Client Service (If Flushing Fails)

  1. Press Windows + R, type services.msc, and press Enter.
  2. In the Services window, scroll down to find DNS Client.
  3. Right-click on DNS Client and select Restart. (If it's not running, right-click and select Start.)
  4. Wait a few seconds for the service to restart. This clears the cache as well.

Common Mistakes

  • Not running as administrator: If you run ipconfig /flushdns without admin rights, you'll get an error: "The requested operation requires elevation." Always use Ctrl+Shift+Enter or right-click and select "Run as administrator".
  • Typing the command wrong: Common typos include ipconfig /flush or ipconfig /flushdns with a space. The correct command is ipconfig /flushdns (no space before the slash).
  • Confusing with browser cache: Clearing the DNS cache does not clear your browser's cache (images, cookies, etc.). If a webpage still looks old, you may need to clear your browser's cache separately.
  • Using the wrong terminal: On Windows, ipconfig works in Command Prompt, PowerShell, and Windows Terminal. But Clear-DnsClientCache only works in PowerShell or Windows Terminal (when it's set to PowerShell).

Tips

  • After flushing, you can verify the cache is empty by typing ipconfig /displaydns and checking that the list is blank (or only shows localhost entries).
  • If you're troubleshooting a specific website, also try restarting your router or modem to clear the DNS cache on that device.
  • If you use a third-party DNS service (like Google Public DNS or Cloudflare), flushing the local cache is still useful, but you may also need to clear the cache on the router if it has one.
  • You can create a desktop shortcut to run the flush command quickly: right-click your desktop, select New > Shortcut, and type ipconfig /flushdns (or the full path to cmd.exe with the command). But you'll still need to run it as administrator.

Troubleshooting

If the flush command fails:

  • Make sure you're running the command as administrator. Right-click the Command Prompt or PowerShell icon and select "Run as administrator".
  • If you get "The system cannot find the file specified," check that you're typing ipconfig correctly (it's a single word).
  • If the command says "Unable to flush the DNS Resolver Cache," try restarting the DNS Client service as described in Method 4, then try again.

If websites still don't load after flushing:

  • Restart your router and modem to clear their DNS caches.
  • Try a different browser or clear your browser's cache.
  • Run ipconfig /renew and ipconfig /release (as administrator) to refresh your IP address.
  • Check if your DNS server is responding: use nslookup example.com to see if it resolves. If not, try changing your DNS server to a public one like 8.8.8.8 (Google) or 1.1.1.1 (Cloudflare) in your network adapter settings.

If the DNS Client service won't restart:

  • Open Services as administrator (right-click the Start button > Computer Management > Services).
  • Right-click DNS Client, select Properties, and ensure the Startup type is "Automatic" and the service status is "Running".
  • If it's stuck, try restarting your PC.

Frequently Asked Questions

Is it safe to flush the DNS cache?

Yes, it's completely safe. Flushing the DNS cache only removes temporary records of domain-to-IP mappings. Your computer will simply re-query the DNS server the next time you visit a website, which may cause a slight delay on the first visit.

How often should I clear the DNS cache?

There's no set schedule. Clear it when you experience DNS-related issues like websites not loading or showing outdated content. It's not something you need to do regularly for maintenance.

Will clearing the DNS cache speed up my internet?

Not necessarily. It can speed up access to a website if the old cache had a wrong or outdated IP address, but it generally doesn't improve overall internet speed. It may cause a slight slowdown on the first visit to each site after clearing.

Does clearing the DNS cache log me out of websites?

No. DNS cache is unrelated to your login sessions. Clearing it won't log you out of any websites. However, clearing your browser's cache (cookies and site data) could log you out.

Can I clear the DNS cache on Windows without admin rights?

No. The ipconfig /flushdns command requires administrator privileges. If you don't have admin rights, you'll need to contact your system administrator or use a standard user account with permission to run elevated commands.

What is the difference between ipconfig /flushdns and Clear-DnsClientCache?

They do the same thing: clear the DNS resolver cache. ipconfig /flushdns works in Command Prompt, while Clear-DnsClientCache is a PowerShell cmdlet. Both are equally effective.