How to clear DNS cache in macOS

DNS is the short form of Domain Name System. As the name indicates, it is a service which resolves the name of the website to its IP address. In all the operating system, the system maintains a DNS Cache which lists down websites to its IP addresses. This makes sure that the browser doesn’t have to figure out the IP address every time. Sometimes this cache can cause some issues, and you will need to clear the DNS cache. In this article, we are discussing how to clear the DNS cache in macOS.

How to clear DNS cache in MacOS

If you are facing trouble browsing websites which either the browser is not able to find, or you are getting an error which says the website is taking a lot of time to respond, it could be the problem with the DNS Cache.

While you can always cross check from your Mobile or another PC, but if they are working all right, let’s figure out to clear the cache. It is a pretty simple process. That said, its little different for every MacOS version Use the respective command lines accordingly to clear DNS cache in MacOS. Open the terminal on your computer and run the following commands respectively.

OS X 12 (Sierra) and later

sudo killall -HUP mDNSResponder;sudo killall mDNSResponderHelper;sudo dscacheutil -flushcache

OS X 11 (El Capitan) and OS X 12 (Sierra)

sudo killall -HUP mDNSResponder

OS X 10.10 (Yosemite)

Versions 10.10.4+

sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder

Versions 10.10.1, 10.10.2, 10.10.3

sudo discoveryutil udnsflushcaches

Older versions

OS X 10.9 (Mavericks)

dscacheutil -flushcache; sudo killall -HUP mDNSResponder

OS X 10.7 (Lion) and 10.8 (Mountain Lion)

sudo killall -HUP mDNSResponder

OS X 10.5 (Leopard) and 10.6 (Snow Leopard)

dscacheutil -flushcache

OS X 10.4 (Tiger)

lookupd -flushcache

How to clear DNS in macOS using an App

These command lines can be a little complicated for at least some people. If you are one of them and is confused at this part, here we have an easier method to clear the DNS cache in your Mac. There is a tool called CleanMyMac which works as a simple solution to clear junk files and optimize the performance of Mac running devices. Follow the steps below to flush DNS with CleanMyMac utility.

Cleanmymac uility for DNS Cache

    1. Download and run CleanMyMac tool.
    2. You can see some options on the left menu. Click on the option named as Maintenance. 
    3. Now tick on an option named Flush DNS Cache.
    4. Click on the Run button.

That’s it! Once the process is finished, your system will be ready to rock again. This tool will quickly flush the DNS cache in your PC and will fix the internet connectivity issues.