How to clear DNS cache on MacOS

If the DNS settings of any site have been changed and in order not to wait for the time to cache DNS records, you can manually clear them, after which the DNS client on MacOS will request new data from the DNS servers.

On MacOS 10.10.4 and higher, to clear the DNS cache, you must run the following command in Terminal:

sudo killall -HUP mDNSResponder

In older versions of MacOS, other commands may be used to clear the DNS cache:

sudo discoveryutil mdnsflushcache
sudo dscacheutil -flushcache

To execute any of the commands, you need to know the administrator password.

If the command is successful, no message will be displayed.

See also my article:
How to clear the DNS cache in Windows

Leave a comment

Leave a Reply