Flush Local DNS on Mac

Terminal

Flush the DNS cach for the following Mac OS'sOS X Yosemite
Use the following Terminal command to reset the DNS cache:
sudo discoveryutil mdnsflushcache

OS X Mavericks, Mountain Lion, and Lion
Use the

Code

//Mac OS X v10.6
dscacheutil -flushcache

//OS X Mavericks, Mountain Lion, and Lion
sudo killall -HUP mDNSResponder

//OS X Yosemite
sudo discoveryutil mdnsflushcache