If you have trouble viewing web pages in your browser, then the first thing you need to look into is your DNS servers. If you have recently changed them, you will need to flush your DNS cache so that new cache can be created and so that the old cache does not interfere with the new servers.

Every time you see an issue with resolving websites in your browser, you should try clearing the cache, as that is the culprit most of the times causing problems to your browsing sessions. Once you have cleared the cache, you should be able to visit your websites without any issues.

If you happen to run macOS Sierra, the latest version of the macOS, then the following guide should help you to clear the DNS cache on your version of macOS so you can resolve any issues you might have.

Here’s how to do that:

Clearing the DNS Cache on a Mac running macOS Sierra

This should work as long as you run macOS 10.12 or latest on your machine. Please keep in mind that this should not work for the older versions of Mac OS. You need to Google the guide for your version of OS to clear the cache.

To do the task, the only thing you need access to is the Terminal app on your machine. That’s what will help you clear the cache on your Mac.

Launch the Terminal app on your Mac by clicking on Launchpad in the Dock and searching for and clicking on “Terminal.” The app should open. You can also run the app by opening the “Applications” folder and then going into “Utilities” and double-clicking on “Terminal.”


When the Terminal app launches, type in the following command into it and press enter. Make sure you enter the command properly, or it will not work. You are free to copy and paste the command to avoid any issues.

sudo killall -HUP mDNSResponder;say DNS cache has been flushed


Since the command you have used has “sudo,” you will be asked to enter your admin password to proceed. Enter the password when you are asked, and you will be able to move forward with the process.

After entering the password, you will need to wait for some time as your Mac takes time to remove cache files from the system. Wait for that.

When the cache has been cleared, you will hear a message on your system saying the cache was successfully flushed.

The DNS cache was successfully cleared on your Mac running macOS Sierra.

If you had trouble with the command and it could not clear the cache, you will need to use the following command that does the same job. Enter in the following command in the Terminal app and hit enter and it will clear the cache for you.

sudo killall -HUP mDNSResponder;sudo killall mDNSResponderHelper;sudo dscacheutil -flushcache;say MacOS DNS cache has been cleared


There you go; your cache files have been removed, and they are all set to be built again with new settings.

So, that was how you could clear the DNS cache on a Mac that runs macOS Sierra or latest.

Related Tutorials