How to Clear DNS Cache on Mac (All Versions)

Clear DNS Cache on Mac

Last updated on December 13th, 2024 at 9:12 am

If you are facing connection issues on your MacBook, you might want to know how to clear the DNS cache on your Mac. That’s because the DNS cache acts like a memory that your device refers to when trying to load a website or a server. 

Clearing the DNS cache on Mac isn’t a difficult job. Depending upon your operating system settings, you can quickly clear the DNS cache on Mac. So, let’s not waste any more time, and let’s reset your DNS on all leading MacOS versions. 

What is Exactly DNS Cache?

The DNS cache might sound like a super-complicated tech term, but it isn’t. Domain Name System, aka DNS, lists all domain name attributes to websites visited by you. Remember that it isn’t similar to your recent online history. Domain name information is coded in numbers like 123.142.113.192. 

And whenever you navigate to a new domain, its DNS address changes. If your Mac relies upon outdated DNS records, it can connect to your desired websites. 

The DNS cache is compressed of multiple components, including:

  • Resource Data: Records descriptions such as the hostname and address. 
  • Record Type: Categorize the type of record i.e., A or AAAA records. 
  • Record Name: This shows the DNS entry’s domain name.  
  • Time To Live (TTL): Resource data validity time. 
  • Class: Appropriate protocol group. 
  • Resource Data Length: It is the resource data’s value. 

Why Clear DNS Cache on Your Mac Occasionally?

Mac and other OS platforms perform DNS caching to reduce the DNS servers’ burden during high traffic. It is TTL’s responsibility to determine the cache’s validity period. Till the cache files are valid, your content requests will process without going through the DNS server. 

But if you are using outdated DNS cache files, that can expose you to security vulnerabilities. Sometimes, Mac saves a bad DNS cache when you visit a website that just moved to a new domain name. Therefore, we highly recommend clearing the DNS cache on your Mac. 

Here are a few other reasons to periodically clear your DNS cache:

  • Storing DNS records makes it easier for hackers to track your search behavior and predict your browser history. 
  • The DNS cache files are targeted for DNS spoofing that can endanger your sensitive information. 
  • Importantly, clearing the DNS cache on Mac can solve connection issues and wrongly displayed web content. 

How to Clear DNS Cache in Mac 

As you know what DNS is and why to clear it, let’s move to the main topic: how to clear DNS cache in Mac. 

Before we get started, you have to get familiar with Terminal commands to clear the DNS cache on macOS. Otherwise, you can use the Terminal app and paste the command to clear the cache. So, let’s see how to clear DNS cache on the latest macOS:

Terminal app
  • Go to Applications > Utilities or press Command + Space keys to launch Spotlight and search for Terminal. 
  • Paste the command sudo killall -HUP mDNSResponder in Terminal and press the Return key on your keyboard. 
  • Now, enter your administrator password for the account and hit Return. And your DNS cache is cleared. 
Terminal commands

Interestingly, you can also hear an audio notification when DNS flush is complete using: 

sudo killall -HUP mDNSResponder; say dns cleared successfully

How to Clear DNS Cache on Older MacOS and MacOSX Versions

The initial process is the same where you have to open the Terminal app. But the commands for clearing the DNS cache on most MacOS versions are different. You can use the following commands based on your device’s OS:

Operating System Terminal Command
Mojave (version 10.14)High Sierra (version 10.13)Sierra (version 10.12)Mountain Lion (version 10.8)Lion (version 10.7)sudo killall -HUP mDNSResponder
El Capitan (version 10.11)Mavericks (version 10.9)sudo dscacheutil -flushcache   sudo killall -HUP mDNSResponder
Yosemite (version 10.10)sudo discoveryutil mdnsflushcache   sudo discoveryutil udnsflushcaches
Snow Leopard (version 10.6)Leopard (version 10.5)sudo dscacheutil –
Tiger (version 10.4)lookupd -flushcache

Alternative Way: How to Clear DNS Cache on Mac 

If you aren’t comfortable clearing the DNS cache on your Mac manually, you can use a tool. Yep, you can use cache cleaning tools to automatically remove DNS files from your Mac. For example, CleanMyMac X is a great Mac maintenance tool that can clear DNS cache too. All you need is to download CleanMyMac X on your device and:

  • Launch the software. 
  • Click on the System Junk Tab in the sidebar. 
  • Navigate through the list of found items and click Clean. 

That’s it! All outdated DNS cache files will no longer trouble your connections. 

Extra Facts About Clearing the DNS Cache on Mac

  • Once you clear DNS cache files from your Mac, the next time you try to open a website, it will load a bit slowly. 
  • You can also delete browser caches to delete outdated DNS entries. 
  • Even if your network randomly slows down, you can cache DNS files to fix it. 

Wrapping Words 

There are tons of reasons to regularly clear your DNS cache on Mac. It keeps your system up-to-date, secures your private data, prevents phishing, and so much more. Most importantly, it is super simple to clear DNS caches. 

Periodically, take two minutes out of your schedule and clear your DNS files for safe and fast browsing. And, keep on following us for the more informative posts.

Author Bio:

Dinesh Lakhwani

Dinesh Lakhwani, the entrepreneurial brain behind “TechCommuters,” achieved big things in the tech world. He started the company to make smart and user-friendly tech solutions. Thanks to his sharp thinking, focus on quality and the motto of never giving up, TechCommuters became a top player in the industry. His commitment to excellence has propelled the company to a leading position in the industry.

Leave a comment

Your email address will not be published. Required fields are marked *

Popular Post

Recent Post

Here’s Your Ultimate Guide To Connecting Your Canon Printer to Wi-Fi in 2025

By TechCommuters / January 8, 2025

Canon printers are a popular option for both home and office settings because of their well-known compatibility and user-friendliness. However, you must connect them to a Wi-Fi router to fully utilize their capabilities. Although it may appear difficult, connecting a Canon printer to a Wi-Fi router is simple if you follow the correct instructions. In […]

Top 10 Widget Apps for Android To Enhance Your Home Screen [2025]

By TechCommuters / January 1, 2025

Are you sick of seeing an Android home screen that is disorganized and cluttered? Do you want to give your device more elegance and functionality? If so, Android widget applications are the ideal answer. The use of widgets to improve the Android experience has become essential. They provide usefulness, accessibility, and an aesthetically pleasing method […]

Top 10 Most Popular Offline Racing Games For Android [2025]

By TechCommuters / December 29, 2024

Offline racing games have made a name for themselves in the rapidly changing mobile gaming market. They are ideal for gamers constantly on the road because they can offer exhilarating experiences without requiring an internet connection. These racing games will undoubtedly satisfy your needs if you don’t want to race online or follow leaderboards, even […]

How to Upload/Move/Migrate from iPhoto to Google Photos [2025]

By TechCommuters / December 19, 2024

Admit it or not, keeping up with a large photo collection can be cumbersome, particularly if you’re still using Apple iPhoto. Although iPhoto was formerly a go-to option for many Mac users when it came to storing precious memories, its limited capabilities made it super difficult to organize and view your photos over time. Fortunately, […]

Fortect Software Review: The Ultimate PC & Mobile Cleaning, Optimization & Security Tool

By TechCommuters / December 12, 2024

It’s time to enhance the overall speed and security of your favourite device!  Well, there’s no doubt that maintaining performance and security in this modern digital world has never been as crucial for your devices. Fortunately, software like Fortect are always on the rescue, making users’ lives comfortable when it comes to optimizing and protecting their devices in just a few clicks and swipes.  Fortect is one of the most powerful applications […]

Top 5 Most Dangerous Cyber Attacks of All Time [Full Story]

By TechCommuters / December 2, 2024

The threat of cyberattacks has increased over time, affecting not only government institutions but also small enterprises and respective individuals. The problematic thing is that cybercriminals’ techniques are evolving along with technology, making it increasingly difficult for even the most sophisticated security measures to keep pace and protect your sensitive data from being stolen. In […]

The Dark Side Of Siri: 10 Risks You Can Face Using It [2025]

By TechCommuters / November 26, 2024

Popular Questions About Siri: is Siri safe to use? Is Siri Dangerous? Disadvantages Of Siri? Is Siri Always Listening To You? Siri Security Issues? Siri Privacy Concerns? ———————————————————————————————————————————– It wasn’t long ago when saying something like “Siri, what’s the weather?” or “Hey Siri, set a reminder for me” seemed incredibly futuristic. Now our interaction with […]

10 Best Fighting & War Games for Android and iPhone in 2025

By TechCommuters / November 13, 2024

Mobile gaming has seen exponential growth in modern times, especially in the fighting and war games genre. However, these games require extreme concentration, strategy, precision, and quite a bit of experience to excel. Nonetheless, these genre games have a huge fan base and constantly update and evolve to accommodate the gamer’s needs. If you are […]

How to Setup HP Printer to Wireless Network

By TechCommuters / November 12, 2024

We can see how to connect your hp printer to the wireless network in a simple way. By connecting your Hp printer to the wireless printer you can easily print the documents without connecting it to the wired network such a USB cable and wire. All the hp printers are not supported by the wireless […]

How To Fix Windows + Shift + S Not Working On Windows 11/10

By TechCommuters / November 11, 2024

Are you frustrated because the Windows + Shift + S key combination isn’t working on your Windows 11 or Windows 10 computer? You’re not alone. Many users have reported issues with this handy screenshot feature, but don’t worry – we’ve got you covered. In this comprehensive guide, we’ll explore why the Windows + Shift + […]