Flushing the DNS cache on a Mac is a straightforward process that can resolve many common website connection issues. It involves opening the Terminal application and running a specific command, typically sudo killall -HUP mDNSResponder for modern macOS versions. While the exact command can vary based on your operating system, the outcome is the same: it clears your Mac's locally stored list of website addresses, forcing it to fetch fresh data and often fixing frustrating loading errors.
This guide will walk you through why this matters, how to identify your macOS version, and the precise steps to successfully flush your DNS.
Understanding Your Mac's DNS Cache

Before executing any commands, it’s helpful to understand what the DNS cache is and its critical role in your daily internet browsing.
Think of the Domain Name System (DNS) as the internet's address book. When you enter a human-friendly domain name like "InternetHosting.us" into your browser, the DNS system translates it into a machine-readable IP address—the server's unique location on the internet.
To accelerate this process, your Mac maintains a local DNS cache, which is a temporary record of recent DNS lookups. The next time you visit the same site, your computer can pull the IP address directly from its cache instead of querying an external DNS server again. It's an efficient system designed for speed. If you want to dive deeper into the mechanics, understanding what is DNS is a great starting point.
Why Flushing the DNS Cache Matters
While caching improves performance, it can cause problems when the stored information becomes outdated or corrupted. For instance, when a website moves to a new server, its IP address changes. If your Mac's DNS cache still holds the old IP address, you will be unable to connect to the site correctly.
This mismatch can lead to several frustrating issues:
- Website Loading Errors: You might encounter "page not found" or "server not responding" errors, even for sites you know are operational.
- Outdated Content: Your browser may load an old version of a webpage because it is still connecting to the previous server.
- Poor Connectivity: Unexplained connection drops or slow loading times can often be traced back to a confused DNS cache.
Security and Performance Benefits
Flushing your DNS is not just a troubleshooting technique; it's also a recommended security practice. A compromised DNS cache could be vulnerable to DNS spoofing, an attack where malicious actors redirect your traffic to fraudulent websites by feeding your computer fake IP addresses. Regularly clearing the cache helps mitigate this risk.
By learning how to flush the DNS on your Mac, you gain a valuable tool for maintaining a fast, reliable, and secure internet connection.
Finding Your Current macOS Version

Before proceeding to the Terminal, it's crucial to identify which version of macOS your computer is running. The command to flush the DNS cache differs between operating system versions, and using the wrong one will result in an error.
Fortunately, checking your macOS version is a quick and simple process that ensures you use the correct command from the list below.
How to Check Your macOS Version
Apple makes this information easily accessible. No need to navigate through complex system folders.
Follow these two simple steps:
- Click the Apple icon () in the top-left corner of your screen.
- From the drop-down menu, select the first option: “About This Mac.”
A window will appear displaying the name of your macOS—such as Sonoma, Ventura, or Monterey—in large text. Directly below it, you will find the specific version number, for example, Version 14.5.
Pro Tip: Don't skip this step. Confirming your macOS name and version is the most critical preparatory action before opening Terminal. It guarantees you will use the correct command syntax, making the entire process smooth and error-free.
Once you have this information, you are ready to find the corresponding command and clear your DNS cache.
The Right DNS Flush Commands for Every Mac
Now that you know your macOS version, it's time to use the Terminal, your Mac's command-line interface, to instruct the system to clear its DNS records.
While the Terminal is a powerful tool, the task at hand is simple. The process involves opening the Terminal application, then copying and pasting the single command that matches your operating system.

Accessing the Terminal
The most efficient way to open Terminal is with Spotlight Search.
- Press Command (⌘) + Spacebar on your keyboard.
- Begin typing "Terminal" into the search field.
- Press Enter once the application is highlighted.
A plain window with a blinking cursor will appear, indicating you are ready to proceed.
Commands for Modern macOS (10.12 and Newer)
For most modern Macs, Apple has standardized the command, which simplifies the process. This change coincided with the adoption of the mDNSResponder service for managing DNS queries.
If you are running macOS Sierra (10.12) or any newer version—including Sonoma, Ventura, Monterey, Big Sur, Catalina, Mojave, and High Sierra—this is the only command you need.
Copy the following line, paste it into your Terminal window, and press Enter:
sudo killall -HUP mDNSResponder
You will be prompted to enter your Mac's password. Type it and press Enter again. Note that for security reasons, characters will not appear as you type; this is normal behavior.
What does this command do? The
sudoprefix stands for "superuser do," granting the necessary administrative privileges.killall -HUP mDNSRespondersends a "hang up" signal to the mDNSResponder service, forcing it to restart and clear its cached data.
Commands for Older OS X Versions
If you're using an older Mac, the required command will be different. As Apple evolved its operating systems, the tools for managing network services also changed. It's essential to use the command specific to your OS X version. You can learn more about how these DNS commands have changed over time on siteground.com.
To simplify this, here is a comprehensive reference table. Locate your OS X version and use the corresponding command.
DNS Flush Commands for Every macOS Version
| macOS Version | Terminal Command |
|---|---|
| macOS Sonoma (14) | sudo killall -HUP mDNSResponder |
| macOS Ventura (13) | sudo killall -HUP mDNSResponder |
| macOS Monterey (12) | sudo killall -HUP mDNSResponder |
| macOS Big Sur (11) | sudo killall -HUP mDNSResponder |
| macOS Catalina (10.15) | sudo killall -HUP mDNSResponder |
| macOS Mojave (10.14) | sudo killall -HUP mDNSResponder |
| macOS High Sierra (10.13) | sudo killall -HUP mDNSResponder |
| macOS Sierra (10.12) | sudo killall -HUP mDNSResponder |
| OS X El Capitan (10.11) | sudo killall -HUP mDNSResponder |
| OS X Yosemite (10.10) | sudo discoveryutil udnsflushcaches |
| OS X Mavericks (10.9) | sudo killall -HUP mDNSResponder |
| OS X Mountain Lion (10.8) | sudo killall -HUP mDNSResponder |
| OS X Lion (10.7) | sudo killall -HUP mDNSResponder |
| OS X Snow Leopard (10.6) | sudo dscacheutil -flushcache |
After running the correct command, your Mac's DNS cache is flushed. The Terminal does not provide a confirmation message; if the command prompt returns without an error, the operation was successful.
Confirming the Flush and Clearing Browser Cache

You have successfully run the command in Terminal. In the command-line environment, no news is good news. If the Terminal simply returns a new prompt without an error message, the system-level DNS flush was successful.
However, before you test the website that was causing issues, there is one more critical step. Your Mac's operating system isn't the only component that caches DNS information.
The Second Layer: Your Web Browser
To deliver a faster browsing experience, modern web browsers like Chrome, Safari, and Firefox maintain their own separate DNS caches. This feature is beneficial for performance but can interfere with troubleshooting.
This means that even after clearing your Mac's system cache, your browser might still be using old, outdated data. To ensure a complete refresh, you must also clear your browser's cache.
Key Takeaway: Flushing your Mac's DNS is only half the solution. Your browser's independent cache can retain outdated information, making it essential to clear both for a complete reset.
How to Clear Your Browser Cache
The specific steps vary slightly between browsers, but the objective is the same: locate the history or privacy settings and delete cached data.
- Google Chrome: Navigate to
chrome://net-internals/#dnsand click the "Clear host cache" button. For a deeper clean, go to Settings > Privacy and security > Clear browsing data, and ensure "Cached images and files" is selected. - Safari: In the menu bar, go to Settings > Privacy and click "Manage Website Data…". You can remove data for a specific site or click "Remove All" to clear everything. For easier access, enable the Develop menu (in Settings > Advanced) to add an "Empty Caches" option to your menu bar.
- Mozilla Firefox: Go to Settings > Privacy & Security. Scroll to "Cookies and Site Data" and click "Clear Data…". Make sure "Cached Web Content" is selected before clicking "Clear".
With both your system and browser caches cleared, you can be confident that you are retrieving the most current data from the internet. This two-step process is not just for fixing errors; it's also a good security practice. For example, after you learn how to install an SSL certificate on your website, clearing all caches ensures your browser immediately recognizes the new secure connection.
When Flushing DNS Is Not Enough
Flushing your local DNS cache is an excellent first step in troubleshooting, but it's important to understand its limitations. This command only clears records stored on your Mac; it has no effect on DNS servers across the internet.
Sometimes, the root cause of a connection issue is not on your machine but at the server level.
If you manage a website and have recently changed hosting providers or updated your server's IP address, you will encounter DNS propagation. This is the time required for DNS servers worldwide to update their records with your new information. This process can take anywhere from a few minutes to 48 hours.
The Role of Your Hosting Provider
A reliable web hosting partner is crucial for managing DNS effectively. The efficiency of your host's DNS infrastructure directly impacts propagation speed, which affects your site's uptime and accessibility during transitions.
At InternetHosting.us, we understand that minimizing downtime is a top priority. Our robust DNS management tools and powerful VPS Hosting are designed to facilitate rapid DNS updates, helping to reduce propagation times. For business owners, ensuring your Business Email Hosting is correctly configured with your domain's DNS is equally critical for seamless communication.
Understanding the distinction between your local cache and the authoritative DNS records managed by your host is key. For example, after you learn how to create a subdomain, that new address must propagate across the internet—a process managed entirely by your hosting provider.
Key Insight: Flushing your Mac's DNS resolves issues related to your connection to a website. It does not fix server-side DNS problems or accelerate global DNS propagation for a site you own.
When to Look Beyond a Local Flush
If you have flushed both your system and browser caches but the issue persists, the problem likely lies elsewhere.
If you are a visitor trying to reach a site, you may need to wait for propagation to complete. If you are the site owner, the next step is to verify your domain's DNS settings with your hosting provider. When these steps don't resolve the issue, you may need to explore broader solutions for fixing DNS issues that involve network-level diagnostics.
Still Have Questions About Flushing Your Mac’s DNS?
Even after completing the process, you may have some lingering questions. Let's address the most common ones to ensure you have a complete understanding.
How Often Should I Flush My DNS?
For most users, flushing the DNS is not a routine maintenance task. It should be performed on an as-needed basis when you are actively troubleshooting a specific problem.
Consider flushing your DNS when:
- A website you know is online fails to load on your computer.
- You are a developer who has recently updated DNS records and need to see the changes immediately.
- You experience unusual redirects or other behavior indicative of a DNS issue.
It’s a reset button—use it when necessary, but otherwise, there's no need to perform it regularly.
Is It Safe to Flush the DNS Cache?
Yes, it is 100% safe. Flushing your DNS cache is a routine, non-destructive procedure performed frequently by IT professionals and web developers.
The command does not affect your personal files, applications, or critical system settings. It simply deletes a temporary list of domain names and their associated IP addresses. Your Mac automatically rebuilds this list with fresh data as you browse the web.
What if Flushing the DNS Didn’t Fix My Problem?
If you've flushed your system DNS and cleared your browser cache but the issue remains, it strongly suggests the problem is not on your Mac.
Here are the next logical troubleshooting steps:
- Restart Your Router: Your internet router also maintains a DNS cache. Unplugging it for 60 seconds and plugging it back in will clear its memory and can often resolve persistent connection problems.
- Check DNS Propagation: If the issue relates to a domain you own and recently updated, patience is key. DNS changes can take up to 48 hours to propagate fully across the internet.
- Contact Your ISP: The problem could originate with your Internet Service Provider's DNS servers. A call to their support team can confirm if they are experiencing an outage or other technical issues.
Does Flushing DNS Delete My Browsing History?
No, flushing your DNS cache does not affect your browsing history, saved passwords, cookies, or other personal data stored by your browser.
These are two entirely separate functions:
- The DNS Cache is a system-level list of domain names and IP addresses.
- Your Browsing History is a log of the specific web pages you have visited, stored within your browser.
Clearing the DNS cache has no impact on your browsing history. While you're optimizing your system, you might find our guide on how to improve website speed helpful for additional performance enhancements.
At InternetHosting.us, we empower our clients with the knowledge and tools needed for a seamless online experience. From reliable domain management to high-performance servers, our mission is to provide an infrastructure that simply works. Explore our secure and scalable Web Hosting plans to build your online presence on a foundation you can trust.


