search by tags

for the user

adventures into the land of the command line

flush DNS cache

OS X 10.10.4 onwards

$ sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; say cache flushed

Mac OS X 10.5 and after (leopard)

$ lookupd -flushcache

Mac OS X 10.4 and before (tiger)

$ lookupd -flushcache

Linux

Depending on your distro and configuration one of the following should work.

$ /etc/init.d/nscd restart

$ service nscd restart

$ /etc/init.d/named restart

$ /etc/init.d/dnsmasq restart

$ nscd -i hosts

$ /etc/init.d/networking restart