It seems I do this a few times a month and I always have to look it up. Leaving myself a note for later.
OS X 10.7+
sudo killall -HUP mDNSResponder
except 10.10 - 10.10.3
sudo discoveryutil mdnsflushcache
OS X 10.5 - 10.6
sudo dscacheutil -flushcache