How to Clear DNS Cache in MacOS Ventura & MacOS Monterey

Nov 21, 2022 - 2 Comments

Mac Terminal icon

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:

  1. 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
  2. When Terminal opens you will be presented with a command line prompt, copy and paste the following command string into the terminal window:
  3. sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

  4. Hit the Return key, and when asked you will be asked for the admin password, enter that and hit return again*
  5. Clearing DNS cache on MacOS Ventura

  6. Nothing will be reported in Terminal, but the DNS cache will be flushed and cleared out
  7. 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

.

Related articles:

Posted by: Paul Horowitz in Command Line, Mac OS, Tips & Tricks

2 Comments

» Comments RSS Feed

  1. David says:

    You are the *ONLY* place I’ve found that mentions something could be hard-coded in /etc/hosts. Good job!

  2. David says:

    Make sure that something isn’t hard coded in /etc/hosts.

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site