Tips to Clear Your DNS Cache on Mac

Clearing your DNS cache helps you get to the latest version of a website, especially after changes to a website’s domain. Windows users can clear their DNS cache with a simple command, but Mac users have to put in a bit more work to get it done. In this article, we’ll show you how to flush DNS on Mac, so you can refresh the DNS records stored on your device.

But first…

What does DNS mean?

“DNS” stands for Domain Name Server. This is a server that tells your computer the IP address associated with the domain name of any website you visit. Every website has an IP address, which is a string of identifying numbers and dots. (You can think of it like a telephone number.)

It would be nearly impossible for us to remember the IP address of every single website we visit, so instead, we use domain names. (A domain name usually looks something like this: www.example.com.) The whole point of a domain name is to help people remember your website. That’s why, when you’re buying a domain, in addition to making sure it comes with cPanel like our domains do, you also need to make sure you choose a name that your visitors will like and remember.

The DNS helps your browser translate the domain name you remember into the IP address your computer remembers.

What is the DNS cache?

It would be a pain if your website had to consult the DNS every single time you visited a website, no matter how many times you visited the same website. To make things easier, your computer saves the DNS information in a local DNS cache whenever you visit a website.

After that, when you enter the website into your browser, your computer looks for DNS information in its local cache first. If it finds the website’s information, it uses the DNS cache to visit the website. If your computer can’t find the information in the local DNS cache, it looks for DNS servers across the internet. The local DNS cache ensures that every time you visit a website, your browser gets there in the quickest time possible.

Why would you need to clear your DNS cache?

  • Privacy: The DNS cache stores every website you’ve ever visited. (Every. Single. One.) When you clear your cache, especially if you’re using a public computer, you protect your privacy.
  • Space: The DNS cache doesn’t take up a crazy amount of space on your computer, but if you let the cache get too full, it will take up more space than usual.
  • Address accuracy: Sometimes, websites change their address. Clearing your cache helps keep your records up to date and prevents your cache from returning the 404 ‘Page Not Found’ error.
  • Server migration: When you’re performing server migration, changes to the DNS server happen instantly, but the cache can take up to 48 hours before the change is registered there. Clearing the DNS cache gives you instant access to the correct IP address. This is especially important for websites that need a constant stream of traffic.

How do you flush DNS on Mac?

The way you flush DNS on Mac will depend on which version of Mac OS X your device uses. There have been sixteen versions of the Mac OS from the Cheetah in 2001 to the Catalina in 2019.

Scroll through this guide until you find the one that applies to you.

(Also, clearing your DNS cache will affect your browsing, so try not to schedule a cache flush for a time when you’re browsing the internet.)

How to figure out which version of the Mac OS you’re using

  • STEP 1: Click the Apple icon at the top-right corner of your screen
  • STEP 2: Click “About this Mac

You’ll see the information you’re looking for in a dialogue box.

How to figure out your admin status:

Before you can clear your cache, you’ll need to enter the administrator account password. If this is your computer, your account should be the one with admin permissions, but just in case you need to check, here’s how you do it:

  • STEP ONE: Click the Apple icon at the top-right corner of your screen
  • STEP TWO: Select System preferences
  • STEP THREE: Click the Users and groups icon

This will show you all the accounts that have been set up on your device. The accounts with admin privileges will have the word admin beside them.

To flush DNS on Mac, follow these steps according to your Mac OS:

Mac Catalina 10.15; Mojave 10.14; High Sierra 10.13; Sierra 10.12; El Capitan 10.11; Yosemite 10.10.5; Yosemite 10.10.4; Mavericks 10.9; Mountain Lion 10.8; Lion 10.

  1. On the Finder toolbar, click Go
  2. Select Applications
  3. Select Utilities
  4. Select Terminal
  5. In the space provided, enter the following command: sudo killall -HUP mDNSResponder
  6. Press Return
  7. When prompted to do so, enter your administrator account password
  8. Press Return

That’s it! Your DNS cache is now cleared.

Mac Yosemite 10.10.3; 10.10.2; 10.10.1

  1. On the Finder toolbar, click Go
  2. Select Applications
  3. Select Utilities
  4. Select Terminal
  5. In the space provided, enter the following command: sudo discoveryutil mdnsflushcache
  6. Press Return
  7. When prompted to do so, enter your administrator account password
  8. Press Return

That’s it! Your DNS cache is now cleared.

Mac Lion 10.7; Mountain Lion 10.8; Mavericks 10.9

  1. On the Finder toolbar, click Go
  2. Select Applications
  3. Select Utilities
  4. Select Terminal
  5. In the space provided, enter the following command: sudo killall -HUP mDNSResponder
  6. Press Return
  7. When prompted to do so, enter your administrator account password
  8. Press Return

That’s it! Your DNS cache is now cleared.

Mac Snow Leopard (10.6); Leopard (10.5)

  1. On the Finder toolbar, click Go
  2. Select Applications
  3. Select Utilities
  4. Select Terminal
  5. In the space provided, enter the following command: sudo dscacheutil -flushcache
  6. Press Return
  7. When prompted to do so, enter your administrator account password
  8. Press Return

That’s it! Your DNS cache is now cleared.

Wrapping up

It’s not hard to flush DNS on Mac. All you have to do is check which Mac OS you’re using and follow the steps in this guide!