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… The post How to Clear DNS Cache in Mac appeared first on Hongkiat.

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.

open terminal
Step 2

Copy the following command into Terminal, and hit Return.

sudo killall -HUP mDNSResponder; sleep 2;
enter command
Step 3

Enter your macOS’s password, and hit Return again.

enter password
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
Frequently Asked Questions:
1. Is it safe to clean up DNS cache?

it is generally safe to clear the DNS cache on a Mac. The DNS cache stores information about previously accessed websites and their corresponding IP addresses, so clearing the cache can help resolve issues with accessing certain websites or if changes have been made to DNS records.

2. Does clearing DNS cache speed up internet?

Clearing the DNS cache on a Mac is generally a good practice to help maintain a healthy system and avoid potential issues with accessing websites. But it may not always result in a significant improvement in internet speed.

3. Will DNS on my Mac updates automatically?

DNS information on your Mac should update automatically as needed. However, in some cases, you may need to clear the DNS cache on your Mac manually to resolve issues with accessing websites. Overall, you shouldn’t need to worry too much about managing DNS information on your Mac, as it should update automatically as needed. But if you do encounter issues with accessing websites, clearing the DNS cache can sometimes help.

The post How to Clear DNS Cache in Mac appeared first on Hongkiat.