Use the following Terminal command to reset the DNS cache in OS X v10.10.4 or later:
sudo killall -HUP mDNSResponder
Use the following Terminal command to reset the DNS cache in OS X v10.10 through v10.10.3:
sudo discoveryutil mdnsflushcache
Use the following Terminal command to reset the DNS cache in OS X v10.9.5 and earlier:
sudo killall -HUP mDNSResponder
Use the following Terminal command to reset the DNS cache in OS X v10.6 through v10.6.8:
sudo dscacheutil -flushcache
1454196300