1. Open the Terminal application, found in the Utilities folder within Applications.
2. Now, you need to enter the command syntax given below.
3. Hit the Return/Enter key and enter the admin password when requested.
4. Wait a few moments for the DNS cache to be cleared.
You need to wait until the DNS cache is completely flushed out. Once it is done, a verbal audio alert will confirm that DNS cache is flushed on your Mac. And that'an easy way to clean up DNS cache in macOS Sierra or High Sierra.
2. Now, you need to enter the command syntax given below.
sudo killall -HUP mDNSResponder;say DNS cache has been flushed
3. Hit the Return/Enter key and enter the admin password when requested.
4. Wait a few moments for the DNS cache to be cleared.
You need to wait until the DNS cache is completely flushed out. Once it is done, a verbal audio alert will confirm that DNS cache is flushed on your Mac. And that'an easy way to clean up DNS cache in macOS Sierra or High Sierra.
sudo killall -HUP mDNSResponder;sudo killall mDNSResponderHelper;sudo dscacheutil -flushcache;say MacOS DNS cache has been cleared
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. You may also need to quit and relaunch any active applications which are using DNS or networking, including Safari, Chrome, SSH, and other similar tasks dependent on domain name correspondence.