The domain name system is a global distributed database of matching all web addresses and IP addresses. When you go to different sites, the browser converts the name to an IP address and this data is stored locally on your computer in a cache to speed up access to the same site with the same domain name. And the whole system works well most of the time, but at the same time it makes it difficult to quickly see the changes you are making in the DNS system.
For example, the site has changed the IP address to another, and you still have the old cache in the cache and therefore the site simply does not open.
How to Flush DNS cache in Windows?
To clear DNS cache on a windows computer follow there steps :
- Start command prompt. To do this, click Win + R, enter cmd and then OK.
- At the command prompt, enter command:
- On successful completion of the command you will see message Successfully flushed the DNS Resolver Cache.
Clear DNS Cache on Linux
sudo service network-manager restart
For other distributions:
sudo /etc/init.d/nscd restart
Clear DNS Cache on MacSponsored
In the Apple operating system, all commands are entered in the "Terminal". The easiest way to get into it is through Spotlight: click on the search icon in the upper right corner.
- You can find it another way: open Finder → “Programs” → “Utilities” → “Terminal”.
- Command to be entered on console varies form differnt make of MAC OS
sudo killall -HUP mDNSResponder; sleep 2; echo macOS DNS Cache Reset ;
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder ;
sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder ;
dscacheutil -flushcache;sudo killall -HUP mDNSResponder ;
Mountain Lion & Lion:
sudo killall -HUP mDNSResponder ;
dscacheutil -flushcache ;
lookupd -flushcache ;
- After that, you will be prompted enter the password and wait for the macOS DNS Cache Reset message .