Almost all operating systems cache DNS records to improve the performance of applications and speed up internet access. Browsers do cache DNS records too and to flush these the easiest way is just to close the browser and start ti again. But sometimes there is a need to flush operating system DNS cache. Here’s how you can do that easily.
Most current Linux distributions do not use a DNS resolver cache in the same way that Windows and Mac OS X use. However, as a common DNS caching application sometimes used is the Name Service Caching Daemon (nscd) or . It’s most likely not installed by default so there is no need to flush the cache. But, if you’ve already installed it you can flush the cache by running the following command in a terminal:
What’s DNS resolver cache?
Every time you visit a website or use any software that has access to the Internet (like Skype or WhatsApp) your browser, or that software, finds out on what actual IP address is the website (or server) that you are trying to access. It then stores this information for future use by creating a record consisting of one IP address and that domain name that points to that IP address is created within operating system. If you want to visit that same website again, the system already knows on what IP address it’s wastes no time trying to find that out saving you time. These records are cached for certain period of time and are called DNS Resolver Cache.
Why would anyone want to flush this cache?
Well sometimes IP addresses of some websites or servers may change and your DNS resolver cache might still keep the old IP address. This can result in your computer not being able to reach the website or it reaches an older copy of it. In some circumstances the data may become corrupt and accessing some websites might fail. So, cleaning your DNS cache is something you can try doing when you can’t access some site or in case you know that the website’s IP has changed. It’s also very helpful for web developers or web admins when migrating websites to a new server or IP (other way around is by modifying hosts file).
How can DNS Resolver Cache data be viewed?
Windows: from a command prompt type ipconfig /displaydns and hit enter. If there is too much data you can save that in a text file using this command: ipconfig /displaydns > dnscache.txt and that will create the dnscache.txt file in the current folder and fill it with the output.
Mac and Linux: I don’t know how to do it. If you do please leave a comment. Thank you!
Can't download new apps to your phone because there isn't enough storage space? Lack of…
This issue started to appear on macOS 13 Ventura after recent Dropbox update. I would…
Since this morning (Feb 5th 2020) search just stopped working on my Windows 10 (version…
Many of you have run into a problem when you were working on some old…
After 10 years of running my main desktop computer on Windows 7 - time has…
I installed VestaCP for a clien on a new dedicated server running CentOS 7. Once…