Today here at Arzhost we learn How to Clear DNS Cache On Mac? DNS (Domain Name System) is a temporary memory used by the operating systems and web browsers to store the information of sites visited recently. This information is saved by using the IP address of the website so that it can load in low time on the next visit.
Sometimes this information got corrupted due to malware attacks or any other reason. Therefore, the next time user tries to visit any site, instead of referring to the right side, it takes the site to some other site.
For example, if you visit www.example.com before and later on after the information got corrupted. If you enter www.example.com in the address bar; it will take you to some other malicious site that is merged by the virus.
Therefore, it is essential to flush the DNS cache to avoid the problem and reach the right site. Some users even don’t know how to clear the DNS cache. It is a simple process, and anyone can do it without any technical knowledge.
In this article, we will discuss flushing the DNS cache on Mac.
How To Flush DNS Cache On Mac
It is easy to flush the DNS cache on Mac, but it is essential to know about the Mac OS and the version of OS. Every OS system and even versions use different command lines to flush the memory.
If you don’t know about the OS or version of OS, then follow the below-mentioned steps to find it:
- Click on the apple icon on the left top corner of the Mac
- Click on “About this Mac”
It displays the information about Mac OS and the version of OS as well.
After getting information about OS and version, follow the simple below-mentioned steps.
Step # 1,
Select Go in the menu bar on the desktop Mac
Step # 2,
Select Utilities in the list
Step # 3,
Run the command (Every OS and version has separate command, we will mention all the commands in the below section)
Step # 4,
Click on return, enter the password, and click on return again.
It will clear the memory.
Following are the commands to run for different OS and versions:
For Sierra (10.12), macOS El Capitan (10.11), Mojave (10.14), High Sierra (10.13), and Catalina (10.15)
sudo killall -HUP mDNSResponder
1: For macOS Yosemite (10.10)
sudo discovery until udnsflushcaches
2: For Mountain Lion (10.8), macOS Lion (10.7), and Mavericks (10.9)
sudo killall -HUP mDNSResponder
3: For macOS Snow Leopard (10.6)
sudo dscacheutil -flushcache
4: For macOS Leopard (10.5)
sudo lookupd -flushcache
5: For Tiger (10.4)
lookupd -flushcache
After you clear the DNS cache on Mac, you can hear the voice note that confirms that memory is cleared now.
How To Clear DNS Cache On Linux?
The process of clearing the DNS cache is similar to that of Mac. You can follow the below-mentioned steps to complete the process.
Clear DNS Cache in Ubuntu
Linux also uses a terminal command line to clear the DNS cache.
Step # 1,
Click on activities on the left top corner of the desktop
Step # 2,
A search bar appears after clicking on activities. Type “terminal” in the search bar and hit the enter button to launch the program.
Step # 3,
Enter the following command and press enter
sudo system-resolve --flush caches
Step # 4,
Enter the password and hit the finish button to execute the command.
The above process clears the DNS cache.
Other Distributions of Clear DNS Cache
However, other distributions are also available on Linux besides Ubuntu; you can use the following command to clear the DNS cache.
Just open the command-line interface, as mentioned above, and enter the following line.
sudo /etc/init.d/dns-clean start
After the execution of the command, you can make the DNS cache clear.
Conclusion
The flushing of the DNS cache is essential to resolve the data corruption problems. It is a simple process, and you can quickly execute the process even if you are new to troubleshooting.
Although it is simple to complete the process, you need to know about the OS and version to complete the process. Because, the correct use of command depends on the OS and version, if you use the wrong command, you will face the same problem.
Hopefully, you like the above discussion and get a lot of benefit from it.