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.

Popular Post

Recent Post

Fix Issues Downloading From the Microsoft Store on Windows 11, 10 PC

By TechCommuters / July 17, 2025

Do you get excited when you’re about to download a new app or game? You open the Microsoft Store, click the download button… but nothing happens. Or maybe it starts and then suddenly stops. Sometimes, strange messages pop up like “Something happened on our end” or “Try again later.” That can be really annoying. But […]

Fix Low Disk Space Errors Quickly On Windows 11, 10 PC [2025]

By TechCommuters / July 15, 2025

Low disk space errors can slow down your Windows PC. These errors appear when your hard drive runs out of room. Your computer needs space to work properly. When space runs low, programs crash and files won’t save. Windows shows warning messages about low disk space. Your PC may freeze or run slowly. You might […]

How To Uninstall Software From My Computer: Complete Guide [2025]

By TechCommuters / July 13, 2025

Learning how to uninstall software from my computer is a key skill. Every PC user needs to know this. Old programs take up space. They slow down your system. Unused software creates clutter. When you remove a program from computer, you free up storage. Your PC runs faster. You also fix issues caused by bad […]

How To Manage & Free Up Disk Space On Windows 11 [2025]

By TechCommuters / July 12, 2025

Low disk space on Windows 11 is a frequent issue that can lead to slow performance, program crashes, and failure to save files. Fortunately, understanding how to manage your storage can quickly resolve these problems and keep your system running smoothly. A lot of people aren’t aware that Windows 11 includes built-in features to help […]

Windows 11 Disk Management: Complete Guide [2025]

By TechCommuters / July 10, 2025

Windows 11 comes with many built-in tools. One key tool is Windows 11 Disk Management. This tool helps you control your hard drives and storage. It’s free and already installed on your computer. Many users don’t know about this feature. But it can solve many storage problems. You can create new drives, resize them, and […]

Top 10 Disk Management Tools For Windows 11, 10 PC [2025]

By TechCommuters / July 7, 2025

Your Windows 11, 10 PC needs proper disk care. Isn’t it? Well, a good disk management tool Windows 11, 10 helps keep your computer running fast. These tools fix disk errors and manage storage space better. Disk management is vital for PC health. Your hard drive stores all your files and programs. Without proper care, […]

Top 8 Best Methods To Backup Windows 11: Complete Guide

By TechCommuters / July 3, 2025

Windows 11 is Microsoft’s latest operating system. It brings new features and better security. But like any computer system, it can face problems. Your files might get lost. Your system might crash. Viruses can attack your computer. This is why you need to know how to backup Windows 11. Creating backups is like having insurance […]

Windows 10 Disk Management: Complete Guide [2025]

By TechCommuters / June 30, 2025

To keep your computer running smoothly, it’s important to maintain and organize your storage drives. Windows 10 includes a handy built-in utility for this purpose called Disk Management. Many users don’t know about this powerful feature. They struggle with storage problems. They can’t create new partitions. They don’t know how to resize drives. This guide […]

How to Create And Format Hard Disk Partitions on Windows 11 And 10

By TechCommuters / June 27, 2025

Your computer’s hard disk functions like a large storage container. You can divide it into smaller sections, known as partitions. Each partition operates independently, similar to a separate drive within your system. Windows 11 and 10 make it easy to create and format hard disk partitions. You don’t need special software. The built-in tools work […]

Update Windows Security Signatures Manually On Windows 11/10

By TechCommuters / June 24, 2025

Windows security keeps your computer safe from viruses and malware. The system works by checking files against known threat patterns. These patterns are called security signatures. Without them, your computer becomes vulnerable to attacks. Sometimes, automatic updates don’t work properly. Your computer might miss important security updates. Network issues can block the download process. The […]