How to Flush DNS Cache

How to flush DNS Cache
How to flush DNS Cache

If you’re having connection issues, you might want to clear your DNS cache. In this blog, you’ll learn the benefits of it and how to flush DNS cache on popular operating systems.

Reasons to Flush DNS Cache Periodically

Similar to web browsers, operating systems also store cache files called Domain Name System (DNS) cache. The cache files contain information about all visited websites — hostnames, IP addresses, and resources records.

Most operating systems perform DNS caching to lessen DNS servers’ burden during high traffic. The caches’ validity period is determined by Time To Live (TTL). As long as the cache files are still valid, they will answer content requests without having to go through the DNS server.

Despite so, using corrupt or outdated DNS cache files can lead to error and security vulnerabilities. Therefore, we recommend you to flush DNS cache periodically.

Here are the reasons why you should clear DNS cache regularly:

  • Prevent search behavior tracking — storing DNS records makes it easier for hackers to predict your browser history.
  • Security — DNS cache files are the main target for DNS spoofing, which endangers users’ sensitive information like login credentials and personal data.
  • Solve technical problems — forcing the operating system to search updated DNS records can solve connection issues and incorrectly displayed web content.

Ways to Flush DNS Cache

Depending on your operating system, the steps to flushing DNS cache may vary. The blog below will show you how to do it in Windows, Linux, and Mac OS X.

Microsoft Windows

The following tutorial is applicable for Windows XP, 7, Vista, 8, 8.1, and 10.

  1. Press Windows+R keys together to open Windows command prompt console, then enter cmd.
  2. Type the following command to clear DNS cache files on your computer:
    1. ipconfig /flushdns

If the process is successful, you’ll see the confirmation message as follows:

This image shows the confirmation message that you have successfully flushed DNS cache in Microsoft Windows operating system.

Linux

By default, Ubuntu doesn’t cache DNS records. If you manually install a DNS service like name service caching daemon (nscd), the steps below will show you how to flush DNS cache.

  1. Press Ctrl+Alt+T keys together to open the terminal window.
  2. Enter the following command to clear DNS cache files on init.d subdirectory:
    1. sudo /etc/init.d/nscd restart

Mac OS X

  1. Press the F4 key, then enter terminal in the Launchpad’s search field to open the terminal window.
  2. If you’re using Mac OS Sierra, X El Capitan, X Mavericks, X Mountain Lion, or X Lion, enter the following command:
    1. sudo killall -HUP mDNSResponder
  3. To flush DNS cache on Mac OS X Yosemite, enter the statement:
    1. sudo discoveryutil udnsflushcaches
  4. If you’re running on Mac OS X Snow Leopard, use the command:
    1. sudo dscacheutil -flushcache
  5. For Mac OS X Leopard and below, enter the following command to flush DNS cache:
    1. sudo lookupd -flushcache

Conclusion

When experiencing connection issues or seeing incorrectly displayed web pages, your system might be storing corrupt or outdated DNS cache records. You can quickly solve it by flushing the DNS cache

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this:
satta king tw