How to Flush DNS on a Mac

If there have been changes on your network or you have moved your computer from one network to another your computer may be holding onto old DNS information. You can flush your DNS cache on a Mac using the following steps:

1) On the top right, click on the magnifying glass to open the Spotlight Search Bar and enter in “terminal” without the quotes.

2) Click on the item that says “terminal” to open a terminal window.

3) This will open a Terminal window.

4) In this window type in the following command without the quotes “dscacheutil –flushcache” and press enter.

This will clear out your DNS cache.


Technology improves, and changes, every day. Here is an updated command to flush your system’s cache:

dscacheutil -flushcache;sudo killall -HUP mDNSResponder

Adding this command to your BASH alias file means you won’t have to remember the entire command: Copy and paste the following line in to your ~/bash_aliases file, restart bash, and you’re a single command away from a freshly-flushed DNS cache:

# flush dns
alias flushdns="dscacheutil -flushcache;sudo killall -HUP mDNSResponder;say cache flushed"

(remove the say command if you don’t like it when your Mac talks back.)

Justin has been with Valiant Technology since 2008 and is a member of our Leadership team. His extensive hands-on experience with technology, particularly Microsoft solutions, can be seen in every...

Continue reading

Subscribe to Valiant's Monthly Email Digest

Valiant's monthly email digest is filled with original content written by our staff, tech news, and business insights.