How to flush the DNS cache on Mac OS X

There are so many unnecessarily long articles on how to do this. So here’s the short version \ TLDR of how to flush (or reset) the DNS cache on Mac OS:

Open up a Terminal window and enter the following command (choose the correct OS) to flush the DNS cache. Enter your password when prompted.

MacOS 11 – Big Sur

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Mac OS X 10.7, 10.8 & 10.9 & 10.10

sudo killall -hup mDNSResponder

Mac OS X 10.6

sudo dscacheutil -flushcache