Your computer looks up DNS information when it makes connections to other systems/websites, but some devices keep a cache of this information to prevent having to lookup the same request over and over (i.e. browsing from page to page on the same site).

If you make changes to any DNS information (or someone makes a change to a website, for example), your computer won’t find this out until the cached data expires and it performs another lookup. Flushing the DNS cache will clear out this data and force your computer to make a fresh lookup.

The process of doing this on a Mac has changed over time, so here is how you can flush the cache starting with Catalina and working backwards. All of these commands need to be run in Terminal.

Note: sudo runs the command as an administrator and will ask for your password before it runs.

macOS 10.15 Catalina back to OS X 10.10.4 Yosemite

sudo killall -HUP mDNSResponder

macOS 10.10.1-3 Yosemite

sudo discoveryutil mdnsflushcache

OS X 10.9 Mavericks back to OS X 10.7 Lion

sudo killall -HUP mDNSResponder

OS X 10.6 Snow Leopard back to OS X 10.5 Leopard

dscacheutil -flushcache

OS X 10.4 Tiger

lookupd -flushcache