How to Flush DNS Cache in MacOS Catalina & Big Sur

Aug 27, 2020 - 8 Comments

How to Flush DNS Cache in MacOS Catalina & Big Sur

MacOS users may occasionally need to flush DNS cache on their Macs in order to access certain websites, domains, or for troubleshooting purposes. Flushing DNS cache is particularly common with web developers and network admins, but it’s used with some regularity by other advanced users too. This guide will walk through how to flush DNS cache in MacOS Big Sur and MacOS Catalina.

If you’re unable to access a website that you visited recently, then of course the first thing you’d check is whether you have a working internet connection. But if you’re only facing connectivity issues on that particular website, then it could be a DNS error, and this is an example when clearing out DNS cache can be helpful.

Your Mac stores the IP addresses of web servers that contain pages that you’ve recently visited. However, if this IP address changes prior to the entry in your DNS cache updates, you won’t be able to access the site without resetting your DNS cache. Flushing the DNS cache on your Mac removes all the invalid entries and forces the system to recollect those addresses the next time you visit the website.

How to Flush DNS Cache in macOS Catalina & Big Sur

Before you go ahead with the following procedure, make sure that your Mac is running macOS Catalina or later, as clearing DNS cache on older versions of macOS varies slightly. Now, without further ado, let’s take a look at the necessary steps.

  1. We’ll be using Terminal to flush the DNS cache on your machine. You can open Terminal using Spotlight search. Click on the “magnifying glass” icon located at the top-right corner of your desktop to access Spotlight search. Alternatively, you can open Spotlight by pressing Command + Space bar.

    How to Flush DNS Cache in MacOS Catalina & Big Sur
  2. Next, type “Terminal” in the search field and open the app from the search results.

    How to Flush DNS Cache in MacOS Catalina & Big Sur
  3. Now, type the following the following command in terminal.
    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

    How to Flush DNS Cache in MacOS Catalina & Big Sur
  4. Hit the Return key and you’ll now be prompted to enter the macOS user password. Type in your password and press Return again.

    How to Flush DNS Cache in MacOS Catalina & Big Sur
  5. Close the Terminal window when finished.

That’s pretty much all there is to it. You’ve successfully cleared and reset the DNS cache on your macOS machine.

It’s worth noting that you won’t get a “successful” message after you’ve typed in the command. Just know that it’s done and you can confirm it by opening the website you weren’t able to access before.

It’s good to clear DNS cache every now and then, as occasionally, they could get corrupted due to technical glitches. Similarly, your Wi-Fi router has a DNS cache as well. This is why most people recommend rebooting the router as a troubleshooting step, as it flushes the DNS cache as well.

If your Mac is running an older version of macOS, you might want to learn how to reset DNS cache in macOS High Sierra, or flushing the DNS cache in macOS Sierra and so on. The procedure is similar and involves the Terminal, except for the fact that you’d be typing in a slightly different command.

We hope you were able to correct whatever network issues you were experiencing, or you’re able to access all the websites again after flushing the DNS cache on your Mac. And if you’re having general internet connectivity problems, you may want to try troubleshooting steps to resolve Wi-Fi connectivity issues on your Mac as well.

If you know of another approach to flushing DNS cache on the latest macOS releases, or you have any particular insight, opinions, or advice, share in the comments!

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: Hamlin Rozario in Mac OS X, Tips & Tricks

8 Comments

» Comments RSS Feed

  1. Howard Goodman says:

    Does this clear the DNS for the user account as well as the administrator account?

  2. Graeme says:

    Running Catalina. Unable to enter my password.

  3. Robert Crites says:

    I have a fear of Terminal. But TechTool Pro has a tool for rebuilding the DNS cache and 4 others. Would that be as good?

    • Maddie says:

      I trust OSXDaily, so I select and copy their Terminal commands, open Terminal on my Macs, then paste the command & then hit the return key. Very easy!
      No fear of accidentally messing up the commands.

  4. yyz says:

    Another way, which is often more convenient with wifi is to toggle wifi off/on.

  5. Maddie says:

    Thanks for this tip! Just cleared all our Mac’s DNS caches.

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