How to Flush DNS Cache in macOS Monterey and Big Sur

Sarahi Johns.jpeg
Sarahi Johns
Dec 3, 20214 min read

Summary: In this guide, we will show you how to clear the DNS cache in macOS manually and automatically.

Normally, we don't need to flush 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.

How to Flush DNS Cache in macOS Monterey, Big Sur, and Earlier

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.

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 cache in macOS.

How to Manually Flush DNS Cache on Mac

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.

How to Clear the DNS Cache Using Terminal:

  1. Click the magnifying glass in the status menu bar to open Spotlight.
  2. Type Terminal in the search box and launch it.
    Open Terminal
  3. In the Terminal, paste the command corresponding to your macOS version, enter the administrator password, and press the Return key on your keyboard.
    Clear DNS Cache on Mac with Terminal
    • 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 Clear DNS Cache on Mac

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.

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.

product introduction

BuhoCleaner

Clean and Speed up Your Mac Like a Pro

Free Download