Skip to content

How Do I Flush Mac DNS Cache?

Article Summary

  • Flushing the Mac DNS cache removes bad entries; otherwise, wait about 24 hours for your computer to update them on its own.
  • Open Terminal from your Applications folder and enter the command that matches your OS X version.
  • On macOS Big Sur and Monterey, run 'sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder'.
  • On Yosemite v10.10.4 and Mavericks through Lion, run 'sudo killall -HUP mDNSResponder'; on v10.6, run 'sudo dscacheutil -flushcache'.
  • Enter your computer's password when prompted and the DNS cache will be cleared.

Every time you venture onto the Internet DNS resolutions are being made and your computer stores many of them. 

Eventually, there will come a time when a bad entry is stored. There are generally two ways to remove these entries. First is to allow 24 hours to pass. During such time your computer will seek out and make the necessary DNS updates. Second would be to flush your DNS.

The following guide will walk you through flushing your DNS cache.

The first step to flushing your DNS, is to open Terminal. In Mac you can do this when you go to your Application folder, then Terminal.

Once in Terminal enter in the the line below depending on your OS X version. 

OS X Yosemite v10.10.4:

sudo killall -HUP mDNSResponder

OS X Yosemite v10.10 through v10.10.3:

sudo discoveryutil mdnsflushcache

OS X Mavericks, Mountain Lion and Lion:

sudo killall -HUP mDNSResponder

OS X v10.6:

sudo dscacheutil -flushcache

macOS Big Sur/Monterey: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Once submitted you will need to enter in your computer’s password and the DNS cache will be cleared.

This video will show you how to clear your DNS cache on Mac.