How To Flush DNS Cache in Windows/Mac OS
DNS request are usually cached by our operating system. It’s a good way to speed up the DNS lookups, but sometimes we may want to clear the cache or “flush DNS cache” so that it doesn’t hold the old values that are no longer valid.
What is DNS?
Domain Name System or DNS helps users to obtain data coming from a server to a computer. It’s a sort of system that aids users to get whatever and whenever they would like on their PC or computer. Having said that, there’s nothing to carry out if you are a user. The site admin will do the modifications in DNS and that will reflect on user’s mobile or computer. However, sometime the admin can get cached version of a site, which will not let him/her make any change. To solve that problem, site admin needs to flush DNS or clear DNS cache to get the original version of the site.
If the aforementioned paragraph has not defined anything to you, here is a simple example to understand things quickly. Every website is hosted on a server. No matter, whether that is a free blogspot blog or WordPress blog. The site must be hosted somewhere. Otherwise, the user cannot find the site’s indexed pages or the user’s computer cannot fetch that site.
Why DNS cache is important?
Now, let’s assume that the site admin wants to migrate the site from one hosting to another or one server to another. Now, if you are a site admin, you will do the job and have to give it some time to propagate everything. However, if you need to change anything in between the propagation time, you will have to flush DNS. When you are changing the host, your computer network will keep fetching the site from the old server. It will take 2-3 days to propagate all things and in that meantime, your mobile or computer will show the site fetched from the old server.
In simpler words, your network stores all the information of the server and cannot update that information within moments or automatically. It takes few time to clear the cache automatically.
However, you can solve this problem (not actually a problem though) by clearing DNS cache on your computer. That is not like removing file or folder. It is something different as it is related to internet and networking. However, as a user, you can also do the same to get the latest version of your favorite site if you think that the site admin is about to change the server.
Follow our guide below to “flush,” i.e., clear the DNS cache in Mac OS and Windows operating system.
How to flush DNS cache in Windows 10, 8.1 / 8, 7, or earlier?
- Windows 7 and Vista users, click on the Start button and in the search box, type
cmdand open the command prompt.
Windows XP and earlier Windows edition users, click on the Start button, click on Run to open the Run dialog box. Type
cmdand press Enter to open the command prompt.
- Now, in the command prompt, type the command:
- Press Enter and Windows will clear it’s DNS cache.
How to flush DNS cache in macOS?
Mac (OS Tiger and below) users need to use the following command in the Terminal to clear the DNS cache:
However, in Mac OS X 10.5 Leopard, a new command has replaced
lookupd -flushcache command. So, to clear DNS cache in Leopard, you just need to type the following command in your Terminal and hit enter:
Now, you have to enter the following command to reload the DNS cache,
sudo killall -HUP mDNSResponder
Now, you have to enter your password to get things done.
How do you Flush DNS Cache on Linux?
It is same as other two tutorials. If you are having a Linux machine and you want to flush DNS cache on Linux, Ubuntu or anything else, do follow the subsequent steps.
At first, open Terminal as root. Following that, you have to install NSCD. To do so, just enter the following command,
sudo apt-get install nscd
Now, you just have to restart the NSCD. To do, type the following command,
sudo /etc/init.d/nscd restart
That’s it! Your DNS cache will be reloaded on Linux machine.