How to Flush DNS Cache on macOS Sequoia & Sonoma
If you’re running macOS Sequoia or macOS Sonoma, you might occasionally find yourself in a situation where you need to flush the DNS cache on your Mac. This can be necessary to fix DNS related issues or errors, to clear out outdated DNS settings or records, to resolve issues with certain websites, or even to have the results of a modified hosts file or some other networking component to take effect. Knowing how to flush DNS cache on MacOS can be helpful for troubleshooting some network issues without needing to reboot the entire Mac too.
While flushing DNS cache is perhaps most relevant for more advanced Mac users, it’s fairly easy to accomplish with the execution of a simple Terminal command string.
How to Flush DNS Cache in MacOS Sequoia & MacOS Sonoma
If you’re running macOS Sequoia 15.x or macOS Sonoma 14.x, here’s how you can easily flush and clear the DNS cache:
- Open the Terminal app on the Mac, found in the /Applications/Utilities/ folder or through Spotlight or Launchpad
- Use the following command string at the command line to initiate the DNS cache flush:
- Hit Return, and enter the admin password when requested
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Quit Terminal app when finished
You won’t see any confirmation that DNS caches have been flushed on MacOS, but if the command was executed properly then it will have been successful.
If you’re new to the Terminal, you will notice that there is no visible feedback when you’re typing your password into the Terminal, and that’s intentional as a security mechanism. Just type the admin password when requested and hit return anyway to execute the command and authenticate it.
For most users they won’t ever have a reason to flush DNS cache, but people who do certain types of web, networking, and internet development, or changing DNS or using a custom DNS solution like Surfshark DNS or Cloudflare, may need to flush their DNS caches often.
We’re emphasizing macOS Sequoia and Sonoma here, but this trick works the same in all modern versions of MacOS system software. If you have a much older MacOS version, you can find solutions here instead.