How To Flush DNS Cache on Windows/Linux/Mac

DNS caching in windows OS always created a problem for me whenever I set up a new blog. After few hours or couple of days, I could not access my newly setup blog from my laptop. I used to shout on my ISP because I could access that particular blog on my mobile by the mobile internet but not by broadband internet (neither laptop nor mobile).

When I set up this blog and again encountered the same issue then I knew that problem was not on the side of ISP but the problem was on my laptop. DNS cache stored in my laptop was creating a problem. I learned from one of my friends that how we can flush DNS cache in Windows 10.

What is DNS cache:

It is basically a collection of the recently viewed web addresses, stored in our computer. Due to DNS cache, you start receiving “Page Not Found“/”Page Can’t Be Displayed” or “404 Error Page” messages whenever you try to access any particular site.

How to flush DNS cache on Windows:

Whenever you continuously received “Page Not Found“/”Page Can’t Be Displayed” or “404 Error Page” then must try to flush DNS cache in your computer. It will resolve your problem. Following are the steps to clear DNS cache.

  •  Go to Run (Press Windows key + R ) or Search CMD or Command Prompt on Windows 10

run cmd

  • Type ipconfig /flushdns command in command prompt and hit enter

ipconfig-command to flush dns cache

After hitting enter you will see a message that “successfully flushed the DNS Resolver Cache“.

flush message in cmd


Clear DNS cache in Linux:

Many of the Linux distributors used NSCD (Name Service Caching Daemon) DNS caching application. If you have NSCD you can use following commands to flush DNS cache.

To clear DNS cache for a user:

  • nscd -i hosts

To clear DNS cache for all users:

  • nscd -I hosts

In some Ubuntu and Debian Linux, you can use the following command to flush DNS.

  • sudo service dns-clean restart

Clear DNS Cache in Apple OS X:

Apple OS Mac has a different command for every new version of OS. Identify your OS version and use following commands to clear DNS cache.

Note: Open terminal to run command.

Sierra OS: sudo killall -HUP mDNSResponder
El Capitan: sudo killall -HUP mDNSResponder
Yosemite: sudo discoveryutil udnsflushcaches
Mavericks: sudo killall -HUP mDNSResponder
Mountain Lion: sudo killall -HUP mDNSResponder
Lion: sudo killall -HUP mDNSResponder
Snow Leopard: sudo dscacheutil -flushcache
Leopardsudo lookupd -flushcache

One thing you must keep in mind that if you want to flush DNS cache, you must run the command prompt/terminal as an administrator. If you don’t do that probably; you would not be able to clear cache. A user could be set up with limited privileges on your system.  A user must need administrative power to perform this action.



  1. Ram September 1, 2017

Leave a Reply