Flushing DNS Cache is a quick and easy process that doesn’t require any technical experience.
Moreover, there would be many reasons why you want to clear the DNS cache. The most important reason would be that it may be corrupted.
The corrupted DNS cache can be because of network attacks or viruses. As a result, it may corrupt the IP address mapping of certain websites.
When the DNS cache gets corrupted, then it may redirect your IP address to a malicious website. The malicious websites were inserted into your computer DNS records by hackers.
Sometimes, because of a corrupted DNS cache, it may also lead to 404 errors.
So, when you clear the DNS cache, it will delete all the saved DNS lookup information stored in your computer DNS records.
After clearing the DNS cache, your computer will get fresh data from DNS servers. Now, there would be a correct mapping of websites.
You can flush DNS cache on Mac OS, Windows, Linux, Google Chrome.
What is DNS Cache?
A DNS cache, also referred to as a DNS resolver cache, is a temporary database about previous DNS lookups on a machine’s OS or web browser.
The DNS cache helps to maintain the records of the recently visited websites or any other domain name.
The temporary database is stored in your computer operating system such as Windows, Mac OS, Linux, or it gets stored in a browser like Chrome browser.
Moreover, the DNS cache speeds up websites’ load time since it contains the queried domains’ IP addresses.
So, when the website is requested from the browser, it won’t be redirected or reroute to DNS servers; instead, it will fetch from the DNS cache queries.
Technically, the DNS cache contains the following information:
- Resource data
- DNS Record type
- DNS Record name
- TTL (time to live)
- Resource data length
How to clear DNS cache on Mac OS?
To clear the DNS cache in Mac OS, you need to use the native command-line interface known as Terminal. After that, run the appropriate command depending on the Mac version you are using.
If you are not sure which Mac version you are running, then click on the “Apple” icon on the top right corner of your desktop and then select “About This Mac.”
You can see your current version in the overview section of the window.
Once you have known the relevant information, look below the process for different Mac OS versions.
Mac OS Catalina (10.15), Mojave (10.14), High Sierra (10.13), Sierra (10.12), El Capitan (10.11)
Step 1: You can launch the terminal by going to “Go” and then “Utilities.” Another way, you can press Command + Space to launch Spotlight and then search for “Terminal.”
Step 2: In the Terminal, you have to type the below command and then press “Return.”
sudo killall -HUP mDNSResponder
Next, the prompt window will ask you to enter your computer password.
After that, it will clear the DNS cache.
Similarly, the process would be somewhat the same for all Mac OS versions, but the command would be different.
So, here, we will discuss the command we can use for another version of Mac OS.
Mac OS Yosemite (10.10)
For Yosemite (10.10), you enter the below command in the terminal and click “Return” to flush the DNS cache.
sudo discoveryutil udnsflushcaches
Mac OS Mavericks (10.9), Mountain Lion (10.8), Lion (10.7)
You have to enter the below command for these versions of Mac OS.
sudo killall -HUP mDNSResponder
Mac OS Snow Leopard (10.6)
If you are running Mac OS Snow Leopard (10.6), then use the below command, enter the password and flush the DNS cache.
sudo dscacheutil -flushcache
Mac OS Leopard (10.5)
The user who is using Mac OS Leopard (10.5) can type the below command.
sudo lookupd -flushcache
Next, enter the password and clear the DNS cache.
How to clear DNS cache in Windows operating system
You can clear the DNS cache in Windows OS by opening the command prompt window and type in the below command.
After successfully flushing the DNS cache, it will display the confirmation message.
Let’s look into different versions of Windows and follow the steps to open the “Command Prompt” window.
How to clear DNS cache in Windows 10
In Windows 10, you have to press Windows key + S and start typing “Command prompt.”
Next, type the below command in the command prompt window.
How to clear DNS cache in Windows 8, 8.1
In Windows 8, 8.1, you can click on the “Start” button and then swipe or scroll to the right-side of the Apps screen.
Next, you can find Windows Systems and select the Command Prompt to open it.
There you can type in.”
ipconfig /flushdns” and then flush the DNS cache.
How to flush DNS cache in Windows 7 and Windows XP
In Windows 7 and Windows XP, you have to click the “Start” button and then navigate to the “All programs” and then “Accessories.”
In Accessories, you can locate “Command Prompt” and open it.
In the open command-line interface, you have to type in.”
ipconfig /flushdns” and flush DNS cache.
How to clear DNS cache on Linux?
Flushing the DNS cache in Linux operating system is somewhat similar to Mac OS and Windows OS.
Clear DNS cache on Ubuntu
You can flush the DNS cache on Ubuntu by opening the command line interface.
In Linux, the “terminal” is the command-line interface, which you can open by going to the “Activities” in the top-left corner of your desktop.
Next, it will provide you with a search box, where you can enter the word “terminal” and then launch the program.
In the “terminal” window, you have to type in the below command:
sudo systemd-resolve --flushcaches
After that, it will prompt you to enter the password. Next, it will execute the command and flush the DNS cache.
Clear DNS cache on other Linux distributions
If you are using other Linux distributions, you can flush the DNS cache by running the below command.
sudo /etc/init.d/dns-clean start
How to clear DNS cache on Google Chrome
You can also clear the browser’s DNS cache other than OS’s DNS cache. In Google Chrome, you have to type the below address in the address bar.
It will prompt you with a screen showing “clear host cache.” You have to click the button and flush the DNS cache on Chrome.
Flushing DNS cache would be haunting for many, but it is an easy and straightforward process.
You have to look into which OS version you are using and follow the steps described above. Moreover, the command would be different for different versions of OS.