Flush DNS Cache on OS X

works for at least 10.6 and 10.7

sudo dscacheutil -flushcache || sudo killall -HUP mDNSResponder