How to Clear DNS Cache in macOS Catalina

Clear DNS Cache in macOS Catalina

DNS cache is the local temporary database of DNS data for faster Domain to IP mapping. DNS cache keeps records of all recently visited websites, so your next hit will be faster.

Also see How To Reset DNS Cache In MacOS High Sierra

When you try to access a website, the request first checks DNS server records the find the IP address of the domain. Then your request is forwarded to the IP address. Your computer also adds that entry in the local DNS cache, so next time if you visit the same website, it can get the IP of the domain from the local DNS cache in place of asking the DNS server again. In this way, DNS cache speeds up the process by handing domain to IP resolution of recently visited websites.

But there’s a small problem associated with this. What if a website recently moved to a new server. Local cache’s DNS entry for that website will still point to the wrong IP address. If you try to visit the website, it will not open until the DNS cache renews the record. For solving the issue instantly, you can clear and reset the DNS cache. In this article, I will tell you how to clear the DNS cache in macOS Catalina. The process of clearing DNS cache Catalina is a bit different than in the older macOS versions.

Also see: How to clear DNS cache in Android devices

Clear DNS Cache in macOS Catalina

Step 1: Open spotlight search wither by cling on the search icon located at the top right side or by pressing keyboard shortcut Command + Space. Here, type Terminal and press enter the launch Terminal app.

Clear DNS Cache in macOS Catalina

Step 2: Enter following command in the Terminal, and hit Return

sudo killall -HUP mDNSResponder; sleep 2;

It will ask macOS’s password. Enter and hit return.

Step 3: Quit Terminal app by using the keyboard shortcut: Command + Q.

That’s it. DNS cache should now be cleared. This command will not work on older versions of macOS. Here are the commands to clear DNS cache for older version of MacOS.

“Mojave” (Version 10.14)
sudo killall -HUP mDNSResponder; sleep 2
“High Sierra” (Version 10.13)
sudo killall -HUP mDNSResponder; sleep 2
“Sierra” (Version 10.12)
sudo killall -HUP mDNSResponder
“El Capitan” (Version 10.11)
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
“Yosemite” (Version 10.10)
sudo discoveryutil mdnsflushcache;sudo discoveryutil udnsflushcaches
“Mavericks” (Version 10.9)
dscacheutil -flushcache; sudo killall -HUP mDNSResponder
“Mountain Lion” (Version 10.8)
sudo killall -HUP mDNSResponder
“Lion” (Version 10.7)
sudo killall -HUP mDNSResponder
“Snow Leopard” (Version 10.6)
sudo dscacheutil -flushcache
“Leopard” (Version 10.5)
sudo dscacheutil -flushcache
“Tiger” (Version 10.4)
lookupd -flushcache

Wrap up

Now you know how to clear DNS cache in macOS Catalina. I have also added commands to clear DNS cache in older versions of macOS. If you face trouble accessing a few websites while the internet is working fine, you can try e-learning DNS cache. It will most probably solve your problem.

Tags: |

Deepanker Verma is the founder of Techlomedia. He is a tech blogger, developer and gadget freak.


Similar Articles

0 Comments

Leave a comment

Comment policy: We love comments and appreciate the time that readers spend to share ideas and give feedback. However, all comments are manually moderated and those deemed to be spam or solely promotional will be deleted.

2020 UseThisTip | Part of Techlomedia Internet Pvt Ltd Developed By Deepanker