macOS Clear DNS

Need to clear your DNS cache on you Mac? This can simply be done in terminal


1. Open Terminal and run this command


sudo killall -HUP mDNSResponder


2a. (Optional) Make a script

Using your preferred editor create a file called cleardns

Paste in the below text and Save the File.



sudo killall -HUP mDNSResponder


2b. Make the file executable


chmod a+x cleardns


2c. Move the file to /usr/local/bin


sudo mv cleardns /usr/local/bin/


That’s it. Now when you want to clear your cache from terminal type “cleardns”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.