How to Flush DNS Cache on Different Operating Systems

How to Flush DNS Cache on Different Operating Systems

To make every site visitor’s experience user-friendly, the browser collects the local data of a site they visit. It means when they revisit the same site, it will load faster. Similarly, your operating system also collects the local data and stores in its database.

The cache consists of hostnames, IP addresses, and many other records.

Sometimes, when you make such changes to the DNS server of your domain associated with a site, it doesn’t work on your system properly. It might happen because of the old cache.

You are required to clear your browser’s cache as well as the local DNS cache of the computer/laptop. If you don’t delete this cache, whenever you visit a site that has been updated, you will see its older version because the local cache might be loading old records and files.

There Are A Reasons Why You Should Clear Local DNS Regularly:

1). To see the latest version of a site.

2). To maintain your security because caching files have sensitive data that shouldn’t be leaked. And attackers perform DNS Spoofing on such caching files.

3). Such a local DNS cache forces the operating system to troubleshoot when it’s not required. It might lead to displaying the wrong content.

Different Ways to Flush DNS Cache

Every operating system has a different method to flush its DNS cache. It also depends on the version you’re using. I am going to list down a few solutions for different operating systems.

->>For Microsoft Windows.

These steps work for Windows 7, 8, Vista, 8.1, and 10.

  • Press Windows+R to open the command prompt and enter cmd.
  • Add this command: ipconfig /flushdns
  • After the process gets completed, you will see a message.

–>>For Linux

Many people use Linux to develop games and a lot more. So, they have to run a different command to flush the DNS cache. However, it doesn’t store DNS cache by default. If you’re using an external service to collect cache, here are a few steps to follow:

  • Open the terminal by pressing Ctrl+Alt+T together.
  • Run this command: sudo /etc/init.d/nscd restart

–>> For Mac OS X

Many people who use a different version of Mac OS need different commands to flush DNS cache.

  • Open the terminal directly by searching for it.
  • If you use Mac OS Sierra, X El Capitan, X Mavericks, X Mountain Lion, or X Lion, here is the required command: sudo killall -HUP mDNSResponder
  • If you use Mac OS X Snow Leopard, use this command: sudo dscacheutil -flushcache
  • If you use Mac OS X Yosemite, here is the command: sudo discoveryutil udnsflushcaches
  • If you use Mac OS X Leopard, here is the command you can use: sudo lookupd -flushcache

Depending on the operating system you use, you can enter these commands. If you have an old computer/laptop, you might have an older OS version.

Conclusion

After going through such commands, you might have already found what you’re looking for. I understand it can be a little bit technical to use the terminal. But you don’t need to do anything other than just pasting a command and press enter.

Once you flush DNS cache, everything will work the way you want. The site will be visible having the latest content you have added and a lot more. There will be no DNS issues because of the local cache.

HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top