How to flush local DNS cache on Mac

Flush the local DNS cache on a Mac to clear cached DNS records.

Flushing DNS Cache on Mac OS X Yosemite:

Use the following Terminal command to reset the DNS cache:

sudo discoveryutil mdnsflushcache

Flushing DNS Cache on Mac OS X Mavericks, Mountain Lion, and Lion:

You can use the same command to flush the DNS cache on Mac OS X Mavericks, Mountain Lion, and Lion:

sudo discoveryutil mdnsflushcache

Simply open the Terminal and run the appropriate command based on your Mac OS version to clear the DNS cache.