how to flush DNS cache on a Mac

macOS 10.10.4 – 10.14.x

sudo killall -HUP mDNSResponder

macOS 10.10.3

sudo discoveryutil mdnsflushcache

OS X 10.7 – 10.8

sudo killall -HUP mDNSResponder

OSX 10.5 – 10.6

sudo dscacheutil -flushcache

Windows

ipconfig /flushdns

Linux

/etc/init.d/named restart

or…

/etc/init.d/nscd restart