Today I Learned: How to flush DNS on macOS Big Sur

Brendan Thompson • 9 March 2021

One thing I continually forget how to do is how to flush DNS on a macOS, to give Windows one piece of credit I must say it is very easy to flush DNS there.

Any time I do any sort of development that requires changes to DNS recores, or I decide I want to update hosting provides I always have to muck around awhile before I get this going.

Flushing DNS is relatively simple, it requires one to execute a couple of commands from a Terminal/ iTerm window.

The below are the commands that are required in order to flush DNS.

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder