How to clear the DNS cache in Windows

Learn how to flush your DNS cache to fix internet issues

When you purchase through links on our site, we may earn an affiliate commission.Here’s how it works.

When something stops your favorite websites from loading it can be frustrating. But it can also stand in the way of getting important work done, so it’s vital to get things up and running again as soon as possible.

One thing that can go wrong is that the DNS cache can become corrupt. This can be thought of like an address book, used by Windows to translate URLs into IP addresses – issues here can stop sites from loading.

Thankfully, clearing the DNS cache in Windows is something that can be achieved very quickly. While it is not guaranteed to fix your internet issues, it is certainly worth a shot. Here’s how to do it.

Tools and Requirements

Steps to clear the DNS cache in Windows

Step by step guide

1. Restart Windows

If you can, you could simplyrestart Windowsto have the DNS cache automatically cleared. There is no special technique to this – you can either opt to restart your computer, or turn it off and on again. It may not be possible to restart immediately, so we’ll now look at DNS flushing options that don’t involve a restart.

2. Flush DNS from the Command Prompt

There are numerous other ways to clear the DNS cache, so you can pick whatever works best for you. To use the Command Prompt, hit the Start button, typecmdand when theCommand Promptentry shows up, clickRun as administratorand then clickYesin the User Account Control dialog. Type the commandipconfig /flushdnsand pressEnter. You should see a message informing you that the command was successfully completed.

3. Flush DNS using the Run command

The same command can be used in the Run dialog if you prefer. PressWindows+Rto activate the Run command and type the commandipconfig /flushdns. To run this command as an administrator – which you will need to do – you need to pressCtrl + Shift + Enter. Again, you will have to clickYesin the User Account Control dialog that appears.

4. Flush DNS using PowerShell

You can achieve the same results with PowerShell, but you will use a different command. Click the Start button, typePowerShell, and clickRun as administratornext toWindows PowerShell. Type the commandClear-DnsClientCacheand pressEnter. Unlike the Command Prompt, PowerShell will not give you confirmation that the DNS cache has indeed been flushed.

5. Create a batch file

Although it really shouldn’t be necessary to clear the DNS cache often, a batch file can be a time-saver. Open Notepad from the Start menu and typeipconfig /flushdnsin a blank document. ClickFile>Save as, selectAll typesfrom theSave as typedrop-down menu and then typeFlushDNS.batin theFile Namefield. You can double-click the file to execute the command in future.

Final Thoughts

The easiest way to flush the DNS cache by simply restarting Windows, but this is not always convenient. You may have a very good reason for not wanting to or not being able to restart your computer, and this is why it is so helpful to know how to manually clear the cache as we have explained here.

Numerous things beyond your control can impact whether your internet works or not, and it can be a matter of trial and error trying to home in on the culprit. This is why it is so helpful to have tricks such as flushing the DNS cache up your sleeve – you just never know when it might come in handy.

Get the best Black Friday deals direct to your inbox, plus news, reviews, and more.

Get the best Black Friday deals direct to your inbox, plus news, reviews, and more.

Sign up to be the first to know about unmissable Black Friday deals on top tech, plus get all your favorite TechRadar content.

Sofia is a tech journalist who’s been writing about software, hardware and the web for nearly 25 years – but still looks as youthful as ever! After years writing for magazines, her life moved online and remains fueled by technology, music and nature.

Having written for websites and magazines since 2000, producing a wide range of reviews, guides, tutorials, brochures, newsletters and more, she continues to write for diverse audiences, from computing newbies to advanced users and business clients. Always willing to try something new, she loves sharing new discoveries with others.

Sofia lives and breathes Windows, Android, iOS, macOS and just about anything with a power button, but her particular areas of interest include security, tweaking and privacy. Her other loves include walking, music, her two Malamutes and, of course, her wife and daughter.

You can find her onTwitterandMastodon.

Windows 11’s Paint and Notepad apps are getting smart new AI features – though one of the best will be for Copilot+ PCs only

Windows 11 24H2 misery continues, as Microsoft’s buggy update is now breaking printers – especially on Copilot+ PCs

Another reason to avoid edge-lit 4K TVs: they may fail faster than others, according to this report