How to Clear the DNS Cache on MacOS (All Versions)

When we change the DNS settings of a domain, we often wonder whether the Domain has been pointed or not with the new Name Server. Sometimes it has been updated on other computers and on our computers it’s still the old one. For that you have to clear the DNS cache on your computer.

Clearing or resetting the DNS cache on your Mac operating system is a good idea as it speeds up searches within the same host. But sometimes we just want to clear the cache so that it doesn’t have any invalid values.

If you are using a MacOS computer, follow the steps below to clear the DNS cache on your computer. You need to remember that the commands used to clear the DNS cache are different for each version of MacOS. Below you can see the command to clear the DNS cache for each version of MacOS.

First, open a terminal by opening Finder and going to Applications »Utilities.

When the terminal opens, type the command to clear the DNS cache. Later you will be asked to enter a password.

Here are the commands to clear the DNS cache on MacOS for all versions. (You can see the macOS version by clicking the Apple logo in the upper left corner, selecting About This Mac, and clicking on the Overview tab)

“High Sierra” (Version 10.13) & “Mojave” (Version 10.14)

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

Those are the commands used to clear the DNS cache on MacOS for all versions. I hope this article is useful.

Leave a Reply

Your email address will not be published. Required fields are marked *