How to clear DNS cache in macOS SierraHow to clear DNS cache in macOS Sierra

Mac OS users who have modified their DNS settings may need to clear their DNS cache before the changes take effect. Additionally, sometimes name servers and domains may not resolve as intended if you have stale DNS cache on the Mac, another situation where resetting DNS cache can often be the solution.

We’ll show you how to flush out DNS cache in MacOS Sierra 10.12 and later.

Note: this uses the command line and thus is aimed at more advanced users. It’s fairly rare that a novice Mac OS user would need to reset their DNS cache anyway, but often just rebooting will achieve the same effect.

How to Clear DNS Cache in MacOS Sierra

  1. Open the Terminal application, found in the Utilities folder within Applications
  2. Enter the following command syntax exactly (use copy and paste if in doubt about syntax accuracy):
  3. sudo killall -HUP mDNSResponder;say DNS cache has been flushed
    Clear DNS Cache in MacOSClear DNS Cache in MacOS

  4. Hit the Return/Enter key and enter the admin password when requested (this is necessary because of sudo privileges)
  5. Wait a few moments for the DNS cache to be cleared

You will get a verbal audio alert the DNS cache has been flushed when complete.

This can be particularly important if you have recently made changes to DNS servers in Mac OS and are finding the changes have not taken effect, but is also frequently used by web developers, programmers, and designers who are working with domain names or after editing the hosts file.

Though it’s not always necessary, you may need to quit and relaunch any active applications which are using DNS or networking, including Safari, Chrome, Firefox, Opera, sFTP, SSH, and other similar tasks dependent on domain name correspondence.

Rarely the above command may not work, but an alternative command is available for macOS Sierra 10.12.3 and later that adds an additional focus on a helper process as well, that syntax is:

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

As before, hitting return will execute the command syntax and reset the DNS caches in MacOS 10.12.4 and newer releases.

Remember, this tip is intended for modern versions of macOS including Sierra 10.12 and later. Earlier versions of MacOS often have completely different methods of resetting DNS cache as described here, though since some of the earlier releases are still in deployment it can be valuable to know those methods as well.

Have any comments or tricks to reset DNS cache in MacOS? Let us know in the comments!

Source

Follow Me:
Top Best Sellers!!