Loading...
Changes Saved.
Error Occurred!

KnowledgeBase

How to flush DNS cache on Mac OSX

How to flush the DNS cache (not browser cache) on Mac OSX

Disclaimer - although this is a common / widely-used technique for flushing DNS cache, we provide this for informational purposes only and do not provide support or liability for unexpected results on your Mac or ISP. There may be better and/or updated ways to perform a DNS cache flush on your Mac than what we have documented here. When in doubt consult your Apple / Mac expert.

Purpose - when you move your web site to a new host or new IP address, there is a DNS Propagation period while your ISP waits to grab the new DNS for the change so that you can see the web site from it's new host / new IP. Flushing your DNS cache after your web site has been moved will in most cases allow you to begin accessing the site from it's new location without waiting for lengthy propagation times.

Important things to note - flushing the DNS Cache of your Mac Operating System is different than deleting your browser cache. Simply dumping your browser cache does not have the same effect. IN FACT, if you've just finished moving your web site and changing your nameservers, deleting your browser cache will typically not achieve results. That is the reason for flushing the actual DNS Cache of your system.

With that said, here is the typical method for flushing your local DNS Cache on your Mac OSX so that you can usually more quickly begin seeing the site from it's new host / new IP:

1. First it's a good idea to close all programs and delete your browser cache, and then reboot.

2. After rebooting, with all browsers closed, open the "Terminal" application on your Mac. Typically the Terminal window is found in the Utilities sub-folder of the Applications folder.

At the terminal prompt type in the command below that matches your version of Mac OSX:

On Mac OSX 10.10.4 or later (Yosemite) enter: sudo killall -HUP mDNSResponder
On Mac OSX 10.10 through10.10.3 (Yosemite) enter: sudo discoveryutil mdnsflushcache
On Mac OSX 10.9 (Mavericks) enter:
sudo killall -HUP mDNSResponder (if that doesn't work try: dscacheutil -flushcache)
On Mac OSX 10.7 & 10.8 (Lions) enter:
sudo killall -HUP mDNSResponder
On Mac OSX 10.5 & 10.6 (Leopards) enter:
dscacheutil -flushcache
On Mac OSX 10.4 (Tiger) enter:
lookupd -flushcache

That should clear out the DNS cache on a Mac OS X system.

3. After clearing your system cache visit the web site that has moved. In most cases you will now be loading it from the new location.

FOOTNOTE - A way to tell if you're loading the site from it's new location is if you have previously made note of the IP address that the site was hosted at before, and then doing a "ping" or a "trace route" to the domain and see if the IP address that it's hosted from is different. Usually both the "ping" and "trace route" utilities on Mac OSX are located in Applications > Utilities > Network Utility area of your Mac OSX. If you don't know how to do a ping or a trace route on your Mac please submit a ticket and we'll help you.




Related Articles