How to clear the DNS cache with Terminal in macOS

How to Clear the Local DNS Cache in MacOS
To clear DNS cache on macOS systems, follow the steps below.

MacOS 10.15: Catalina

To flush the local DNS cache on macOS Catalina, follow the following steps.
  1. Open Terminal (Application  Utilities › Terminal or press CMD+SPACEBAR and Type in ‘Terminal’ then select the black Terminal app in the list)
  2. When Terminal Starts type: ‘sudo killall -HUP mDNSResponder’ and press Enter to run the command.
  3. Enter your password (the password usually doesn’t show in Terminal but press enter when you’ve entered the password) which is required because you ran the command using ‘sudo ‘
  4. Press Enter. Close the Terminal.
  5. That’s it! Your local DNS cache in macOS Catalina should have been cleared!
Jon Caldbeck

Jon Caldbeck

Jon is the Executive Director of Next Level Web Design CIC and the founder of the Dual Diagnosis Hub which is a website & organisation that provides and signposts the best support, tools & resources for those with co-occurring mental health & addiction issues.

Blog Posts & Tutorials

This section aims to provide you with tutorials, and guides, on how to do tasks that otherwise you'd have to pay for. Please get in touch if there's a tutorial that you'd like added!

We use cookies to give you the best online experience. By agreeing you accept the use of cookies in accordance with our cookie policy.

Privacy Settings saved!
Privacy Settings

When you visit any web site, it may store or retrieve information on your browser, mostly in the form of cookies. Control your personal Cookie Services here.

These cookies are necessary for the website to function and cannot be switched off in our systems.

In order to use this website we use the following technically required cookies
  • wordpress_test_cookie
  • wordpress_logged_in_
  • wordpress_sec

For perfomance reasons we use Cloudflare as a CDN network. This saves a cookie "__cfduid" to apply security settings on a per-client basis. This cookie is strictly necessary for Cloudflare's security features and cannot be turned off.
  • __cfduid

Decline all Services
Accept all Services
Scroll to Top