Table of Contents
This tip is about the how to Flush DNS Cache on Linux. So read this free guide, How to Flush DNS Cache on Linux step by step. If you have query related to same article you may contact us.
How to Flush DNS Cache on Linux – Guide
Troubleshooting your website can be an intimidating responsibility. When it comes to tasks like flushing the Domain Name Server (DNS) cache, it’s easy to get overwhelmed and confused before you even get started. Fortunately, you can perform this particular task quickly and easily, even without technical experience. In two short steps, your DNS cache will be cleared and you can continue working to resolve any issues you are experiencing.
In this post, we will explain what a DNS cache is and in what situations you might need to clear your cache. We will then share a real-world example from our direct experience and explain how to complete this troubleshooting step regardless of the hardware you are using.
What is DNS Caching?
Similar to web browsers, operating systems also store cache files from previous Domain Name System (DNS) lookups in what is called a DNS cache. It consists of compressed units of information called resource records (RR) about all visited websites, displayed in ASCII code.
Following are the components of a DNS cache:
When visiting a website for the first time, the user’s operating system stores the DNS cache files for that website. It streamlines the DNS lookup process by resolving domains to their IP addresses, making web pages faster the next time you visit the same IP address.
Reasons to flush DNS cache periodically
Most operating systems run DNS caching to lessen the load on DNS servers during heavy traffic. Your TTL determines the validity period of the cache. As long as the cache files are still valid, they will respond to requests for content without going through the DNS server.
Despite this, using corrupted or outdated DNS cache files can lead to bugs and security vulnerabilities. Your operating system may store an incorrect DNS cache when you visit websites that have just been moved to a new domain name or host. Therefore, we recommend flushing your DNS cache periodically.
Here are reasons why you should clear your DNS cache regularly:
Ways to flush DNS cache
Depending on your operating system, the steps to flush a DNS cache may vary. THE tutorial below will show you how to do this on Windows, Linux and Mac OS X.
Microsoft Windows
On Microsoft Windows, flushing the DNS cache is a relatively simple process. Remember that you need to run as administrator when running command prompt to access all system security permissions. Here are the steps to flush DNS cache on Windows XP, 7, Vista, 8, 8.1 and 10.
Linux
By default, Ubuntu does not cache DNS records. If you manually install a DNS service like the name service caching daemon (nscd), the steps below will show how to clear the DNS cache on your computer. Be sure to run as administrator when following these steps.
sudo /etc/init.d/nscd restart
Here they are guide to flush the DNS cache on a system that uses systemd.
systemd-resolve –flush-caches
Type the following at the command prompt to verify that the previous command successfully flushed the DNS cache.
systemd-resolve -statistics
Mac OS X
While the steps to flush a DNS cache on Mac OS X are simple, you need to run the correct DNS flush command based on your current OS X version.
sudo killall -HUP mDNSResponder
sudo discoveryutil udnsflushcaches
sudo dscacheutil -flushcache
sudo lookupd -flushcache
sudo killall -HUP mDNSResponder
sudo killall -HUP mDNSResponder
sudo killall -HUP mDNSResponder
sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder
Clear Your DNS Cache in Google Chrome
Since Google Chrome stores a separate operating system DNS cache on your computer, releasing them will have the same benefits. This is particularly important if you use Google Chrome as your primary browser. Keep in mind that this type of cache is different from browser caching. Here are the steps to do it:
chrome://net-internals/#dns
Final note
I hope you like the guide How to Flush DNS Cache on Linux. In case if you have any query regards this article you may ask us. Also, please share your love by sharing this article with your friends.