How to Clear DNS Cache in MacOS Ventura & MacOS Monterey
Mac users may need to occasionally clear out and flush DNS cache in MacOS, perhaps because they modified their hosts file, or for troubleshooting purposes.
Resetting DNS cache on the Mac is generally only needed by advanced users, but even novice Mac users should find the process to be pretty easy, though it is achieved through the use of the command line.
How to Flush DNS Cache in MacOS Ventura & MacOS Monterey
Here’s how to clear out and reset your DNS cache in modern MacOS versions:
- Open the Terminal application on the Mac, the simplest way to do this is through Spotlight by hitting command+spacebar, then typing “Terminal” and hitting Return to launch the Terminal app
- When Terminal opens you will be presented with a command line prompt, copy and paste the following command string into the terminal window:
- Hit the Return key, and when asked you will be asked for the admin password, enter that and hit return again*
- Nothing will be reported in Terminal, but the DNS cache will be flushed and cleared out
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Quit the Terminal application when finished
* Note that the Terminal will not show passwords when typed as a security precaution. This is normal behavior, so just type it anyway and hit return.
There are many reasons to flush the DNS cache on a Mac, but it’s usually done by more advanced users who are tinkering with DNS settings or doing development type of work. Flushing DNS cache is also part of the troubleshooting process if the hosts file was edited but is not working
You are the *ONLY* place I’ve found that mentions something could be hard-coded in /etc/hosts. Good job!
Make sure that something isn’t hard coded in /etc/hosts.