How to Flush DNS Cache

Learn how to clear the DNS Cache on any machine


Today we're going to tell you how to flush DNS. What does this mean exactly? It means that you will learn different ways to properly clear the DNS cache in both web browsers and computers.

Why is this so important? Because this way you will be able to clear out all the cached DNS resolutions that may be stored on your computer and browsers, which will help avoid false-positive results when you attempt to visit a website.

How can I Flush Cache on Windows?


Clear the DNS cache in Windows 7, Windows Vista and Windows XP

1. We will start by clicking on the Start Menu button on the bottom left of our desktop.

2. After that click on All Programs, now click on Accessories and then right-click on Command Prompt. Pick the option that says "Run as Administrator".

3. Once the Command Prompt is open (is a small black window with white letters) type the following and hit Enter:

ipconfig /flushdns

Great! Now you know how to flush DNS in Windows 7, Windows Vista and Windows XP.

Flush the DNS cache in Windows 8

We will have to use a different procedure.

1. Let's start by hitting the Windows key, or you can move the pointer to the bottom left corner and hit the Windows Icon.

2. Now type Command Prompt and when the app shows up, right-click on it and select the option "Run as Administrator".

3. The next step will be similar to what we did in Windows 7, Vista and XP, just type the following text and hit Enter:

ipconfig /flushdns

Easy, right? With these quick steps, you can clear the system's DNS cache in Windows 8.

How to clear the DNS cache in Windows 10

Now we're moving to the most recent version of Microsoft's operating system. This is even easier:

1. Hit the Windows key

2. Press R and a dialog box will appear

3. Type our usual command hit Enter:

ipconfig /flushdns

That's it. As you can see, flushing the DNS in Windows 10 is even easier than in previous versions of Windows.

Flush DNS Cache on Mac OS operating system


Now let's move to Apple's operating system: Mac, nowadays called OS X.

Clear the DNS cache in OS X 10.4 (Tiger)

Let's start by clicking on the Terminal icon if you have on the Dock, or look for it under in the Application/Utilities/Terminal area of the Finder.

Once the Terminal is open, type the following command and push Enter to finish:

lookupd -flushcache

OS X 10.5 and OX 10.6 both use the same procedure. We have to open a Terminal, which will be available on the Dock or just use the Finder to find it. Run this command in the Terminal and hit Enter:

dscacheutil -flushcache

Flush DNS in OS X 10.7 and OS X 10.8

The steps are almost the same:

Let's start by opening the Terminal app (from the Dock or using the Finder)

Once there type the following text, then press Enter:

sudo killall -HUP mDNSResponder

OS X 10.9 / 10.10 / 10.11 / 10.12 and OS X 10.13

And last but not least, for more recent versions like OS X 10.9, OS X 10.10, OS X 10.11, OS X 10.12 and OS X 10.13:

Let's open a Terminal, type the following commands and this Enter after both of them:

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

That's it! Now you have learned how to clear the DNS cache in OS X.

Flushing DNS Cache on Linux

Finally, let's move into Linux, let's learn how to flush DNS in Linux. For most distros, you will need one of the following commands.

Open a Terminal and try both of them:

sudo /etc/init.d/nscd restart
sudo service nscd restart

For one particular distro, Ubuntu, the command used in the Terminal is a little different:

sudo service network-manager restart

Congratulations! Now you can flush DNS in Windows, OS X, and Linux!

Clearing the DNS Cache on Web Browsers

But keep in mind that sometimes is not enough to just clear the system's DNS cache, sometimes you will have to clear the browser's DNS cache, and the steps are completely different from the ones we've seen so far. Let's start with Windows:

Google Chrome (under Windows)

on the URL bar, write the following and hit Enter:

chrome://net-internals/#dns

This will open a window with a lot of stuff, but you only need to click one button: Clear host cache. And that's it, Chrome's DNS cache will be clear now.

Google Chrome (under Linux)

to clear the DNS cache of Chrome under a Linux distro, just follow the same steps that we use for Windows. Type this command in the URL box of the browser:

chrome://net-internals/#dns

And then just click the "Clear host cache" button.

Google Chrome (under OS X)

And what's the proper way to do this on Mac? Yes, you have guessed, the same as Windows and Linux. Type the following in Chrome's URL box and hit enter:

chrome://net-internals/#dns

Then just click on Clear host cache.

Mozilla Firefox

Now let's move into Mozilla's browser, better known as Firefox. The steps are the same for Windows, Mac OS X and Linux.

First, open Firefox and type the following in the address bar:

about:config

It will ask for you to acknowledge what you're doing. Click the OK button. In the next screen, type the following:

network.dnsCacheExpiration

Double click that option and set it to 0. Now close Firefox and start it again, repeat the previous steps but this time set network.dnsCacheExpiration to 60.

And that's it, this should clear Firefox's DNS cache in Windows, OS X, and Linux.

Safari (under OS X)

To flush DNS cache in Safari, open it and click the Cog icon, now select Reset Safari and check all the boxes. Finally, click the Reset button.

Safari (under Windows): the steps for Windows are almost the same, but instead of a Cog icon, simply open Safari menu, now choose Reset Safari, check the boxed and hit that Reset button.

That was easy too, right? And finally let's move to the Microsoft's Internet Explorer, in case someone is still using it.

Internet Explorer / Microsoft Edge

How to flush DNS cache in Internet Explorer: actually, you don't have to do anything on IE's side.

Simply clear Windows DNS cache (previously explained in this same post), then close Internet Explorer (if it is already open), and simply open it again. Flushing Windows DNS cache and restarting the browser is all that you need to do in this case.