How to Flush DNS Cache in Windows 10 and Mac?
What is DNS?
Great deals of people hear the term “flushing your DNS” and ask, “What is that?” DNS is an acronym for “Domain Name System”, which in essence, is a phone book for the internet. It helps to resolve the descriptive domain name (site address) entered into the browser’s address bar into a numeric IP address quickly. The numeric IP address is the location of a physical server where the content you are looking for is stored. Learn how to change DNS servers in Windows 10, Mac and iPhone.
What is DNS Cache?
Your computer also stores the DNS lookup details in a cache to make the internet connection faster. Over the period of time you visit lot of websites, play online games and do other browsing activities. All these activities will make your DNS cache fills with a DNS IP addresses to all the places that you have visited on the internet. Whenever you visit the webpages again, your computer will refer the DNS cache and resolve the IP address much faster. Now you feel the websites are loaded faster compared to the first time.
Below picture indicates how the resolving of IP address works in general. Besides the caching at your local PC and browser, DNS caching happens will happen at different levels like root server and TLD servers. The purpose of all caching is to speed up the loading of webpages without looking up every time.
Why Should You Flush DNS?
Also there are possibilities that changes occurred the previous DNS servers you have accessed or the website is moved to another server. In these situations, loading of the webpages may take long time or even will never load at all. This is because your computer may still be processing old information or DNS addresses from the DNS cache.
Flushing your DNS essentially wipes the lookup details that you have accumulated and refreshes it with fresh information when you open the sites again.
Before Flushing DNS
Before try flushing the DNS, try simply disconnecting from your internet connection by restarting your router/modem. Once the modem has come back online completely, turn the internet connection on your computer back on. This is more of a simple way usually won’t fix the problem completely. However, for problems like speed, it usually does the job well enough. We would recommend trying this before you try what is outlined in the rest of the article, as the problem may be related to your modem/router.
Open Command Prompt
If the modem/router restarting didn’t work or you couldn’t restart your modem/router, then try doing this. Hold down the “windows key” and press the “R” key. This will open up your “Run” window like below.
With that open, we need to type in “cmd”, and then press the “ENTER” key. This will open the command prompt for you.
How to View DNS Cache in Windows 10?
Before flushing the DNS you can actually view the cached records. Type “ipconfig / displaydns” and press enter. It will show you the list of records cached by your PC.
If you want to test whether DNS caching is working on your PC, just open any of the website. Let us open our own website – webnots.com. Now, go back to command prompt and display the DNS. You will see some entries like below indicating the DNS details (like CNAME and A records) are cached.
Record Name……: www.webnots.com
Record Type……: 5
Time to Live…..: 407
Data Length……: 4
CNAME Record…..: webnots.com
It should look like below on the command prompt:
How to Flush DNS Cache in Windows 10?
Now that you see any of the IP addresses are wrong or you couldn’t conclude then just flush it to clear the cache. Type “ipconfig /flushdns” and press enter. Windows will flush the DNS and show the success message as “Successfully flushed the DNS Resolver Cache”.
Make sure that you include the space between “ipconfig” and the “/”, otherwise it’ll come up with an error, that looks something like this.
You can again test the DNS cache by using “ipconfig / displaydns” command. The website details shown previously should have been removed now.
Flush DNS Cache in Mac
If you are using Apple MacBook then follow the below instructions to flush the DNS cache:
- Press “Command + Spacebar” to open Spotlight Search box.
- Type “Terminal” and open the app. Alternatively, you can click on Launchpad and go to “Other > Terminal”.
- Enter the below command and hit enter.
sudo killall -HUP mDNSResponder
- You will be prompted to enter the admin password.
- There will be no success message but the DNS cache is flushed on your Mac now.