2 Ways to Flush DNS Cache on Mac (Sequoia/Sonoma)

Wendy Wu
Last updated: Sep 10, 2024
Summary: In this guide, we will show you how to flush the DNS cache in macOS manually and automatically.

Normally, we don't need to clear the DNS cache in macOS manually. However, when you experience website loading errors or other network issues, clearing your DNS cache may be an ideal solution. From this guide, you will learn how to flush your DNS cache in macOS in two ways.

Let's get started.

2 Ways to Flush DNS Cache on Mac ((Sequoia/Sonoma))

What Is DNS Cache?

To know what DNS cache is, you first need to know what DNS is.

DNS is short for Domain Name System. It translates a domain name into an IP address with which a web browser can interact. As you know, the IP address of a website is hard to remember, but with DNS, all you need to remember is its domain name.

The DNS cache is also known as the DNS resolver cache. It is a temporary database kept by your Mac that contains records of the IP addresses of all the websites you have recently visited and tried to access. It serves to speed up the resolution of domains.

Is It Safe to Flush DNS Cache on Mac?

Yes, flushing the DNS cache on your Mac is safe and can help resolve certain network-related issues. However, it's worth noting that it may temporarily slow down your internet performance and reset your custom DNS configurations to default settings.

When Should You Reset DNS Cache?

Most of the time, we don't need to clear the DNS cache. Here are some cases you can flush your DNS cache:

  • Can't open certain websites.
  • Suddenly unable to access the network.
  • For security concerns.

Now that you know when you should clear the DNS cache, let's see how to flush the cache in macOS.

How to Flush DNS Cache on Mac Using Terminal

You can clear the DNS cache manually, and the tool you need is the Terminal. You should be aware that the commands you need vary depending on the macOS version. Therefore, it is necessary to click the Apple icon > About This Mac to check the macOS version you are using.

Here's how to flush DNS cache on Mac with Terminal:

  1. Click the magnifying glass in the status menu bar to open Spotlight.

  2. Type Terminal in the search box and launch it.

  3. In the Terminal, paste the command corresponding to your macOS version, enter the administrator password, and press the Return key on your keyboard.
    Flush DNS Cache on Mac Sequoia
    • macOS 10.15 (Catalina) and later:
      sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
    • macOS 10.12 (Sierra), 10.13 (High Sierra), and 10.14 (Mojave):
      sudo killall -HUP mDNSResponder
    • OS X 10.11 (El Capitan):
      sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
    • OS X 10.10 (Yosemite):
      For versions 10.10.4+, use:
      sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
      For versions 10.10.1, 10.10.2, and 10.10.3, use:
      sudo discoveryutil mdnsflushcache; sudo discoveryutil udnsflushcache
    • OS X 10.9 (Mavericks):
      dscacheutil -flushcache; sudo killall -HUP mDNSResponder
    • Mac OS X 10.7 (Lion) and 10.8 (Mountain Lion):
      sudo killall -HUP mDNSResponder
    • Mac OS X 10.5 (Leopard) and 10.6 (Snow Leopard):
      sudo dscacheutil -flushcache
    • Mac OS X 10.4 (Tiger):
      lookupd -flushcache
  4. Quit Terminal.

How to Quickly Flush DNS Cache on Mac Using BuhoCleaner

The above method does clear the DNS cache in macOS, but you need to remember the commands for every macOS version. As you can see, they are long and difficult to remember.

Fortunately, you can use a tool like BuhoCleaner to flush the DNS cache automatically. BuhoCleaner is a simple and easy-to-use Mac cleaner with many practical functions, such as junk file removal, app uninstallation, DNS cache cleaning, Spotlight index rebuilding, and more.

DownloadFor macOS 10.10 and above
100,000+ Satisfied Users Worldwide

Here's how to use BuhoCleaner to flush the DNS cache on Mac:

  1. Download and install BuhoCleaner on your Mac.
  2. Launch it and click the Toolkit in the sidebar.
    Flush DNS Cache on Mac Automatically
  3. From the Toolkit, choose Flush DNS Cache and then click the Start button.
    Flush DNS Cache on Mac with BuhoCleaner

That's it!

Conclusion

Clearing the DNS cache is not something that you need to do often. The next time you encounter a problem with your Internet connection, you can use the above method to flush your DNS cache and see if the error is fixed. If you are a novice, we recommend you use BuhoCleaner to do the job for you.

Wendy Wu is a tech enthusiast with a deep passion for all things iPhone, iPad, and Mac. Wendy is always on the lookout for Apple products and is committed to providing Apple users with some of the latest information and useful tips.