How to Clear DNS Cache in Mac
If you are a macOS user and have recently made changes to your DNS settings, then doing a flush, aka clearing the DNS cache would be a good idea. But why is it important to clear DNS cache?
Well, simply because when your DNS is cached, nameservers or domain name may not resolve to the correct IP and may lead you to a cached website, or worst, failure to establish a connection to the respective website.
How Do I Reset My Mac’s DNS?
In this post, I will show you how to clear and reset DNS cache on your macOS Ventura (Version 13.0). If you are using macOS Monterey or older, click here.
Step 1
Launch Terminal app. You can do it swiftly by executing this keyboard shortcut Command + Space. Then type in Terminal, then hit Enter.
Step 2
Copy the following command into Terminal, and hit Return.
sudo killall -HUP mDNSResponder; sleep 2;
Step 3
Enter your macOS’s password, and hit Return again.
Step 4
Quit Terminal by using the keyboard shortcut: Command + Q.
That’s it, simple as that. Your DNS cache should now be cleared.
How to Reset DNS Cache in Older Macs?
If you are using older versions of macOS, targeting the mDNSResponder
process using the above command may not work. If you are using macOS 12 (Monterey) or below, refer to the following list for the correct command to use.
"Monterey" (Version 12)
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
"Big Sur" (Version 11)
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
"Catalina" (Version 10.15)
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
"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