macOS DNS Cache: How mDNSResponder Works & How to Flush It

Why the "correct" macOS flush command you find online might be outdated, and what actually works on current releases.

📅 Published August 2026· ⏳ 14 min read· ✍️ ToolsNovaHub Editorial Team

Search "flush DNS Mac" and you'll find several different commands across different forum posts and years — a direct result of Apple having changed the underlying DNS caching architecture more than once across macOS's history. This guide explains why, and gives the command that's correct for current releases.

⭐ ToolsNovaHub Pro Tip
Run both parts of the current flush command together — sudo dscacheutil -flushcache followed immediately by sudo killall -HUP mDNSResponder — since the second command ensures mDNSResponder itself restarts cleanly rather than just clearing the directory service cache alone.
⚠️ Common Beginner Mistake
Copying an old macOS DNS flush command from an outdated forum post or article without checking whether it still applies to your current macOS version. Commands that worked on older releases can silently do nothing — or fail outright — on current versions due to the underlying architecture changes covered in this guide.

📝 Introduction

macOS handles DNS caching through a dedicated background process rather than exposing it through a simple, stable command-line flag the way some other operating systems do — and that process's exact behavior, and the command needed to interact with it, has genuinely changed across major macOS releases, which is the direct cause of the conflicting advice you'll find searching online.

⚙️ What Is mDNSResponder?

mDNSResponder is the macOS background daemon responsible for DNS resolution and caching, and it also handles multicast DNS — the protocol behind Bonjour, Apple's zero-configuration local network device discovery system. This dual role is specific to macOS's networking architecture and explains why the same process appears in discussions of both DNS troubleshooting and local network device discovery issues.

🗑️ The Current Correct Flush Command

On current macOS releases, the standard, working approach combines two commands run in sequence in Terminal: sudo dscacheutil -flushcache, which clears the directory service cache, followed by sudo killall -HUP mDNSResponder, which sends a restart signal to the responder process itself. Both require your administrator password via sudo, and running both together — rather than just one — is what reliably produces a full, clean cache flush on modern macOS.

🔄 Why the Command Has Changed Over Time

Apple has restructured the underlying DNS caching and directory services architecture across major macOS version transitions more than once, each time altering exactly which command or combination of commands actually clears the cache. This is precisely why older how-to articles referencing a single standalone command, without the accompanying killall step, may no longer work reliably on current releases — the architecture they were written against has since changed.

📡 mDNSResponder & Bonjour

Because mDNSResponder handles both standard DNS caching and Bonjour's local device discovery, restarting it via the flush command can briefly interrupt in-progress local network discovery — such as AirPlay device detection or network printer discovery — for a moment immediately after the flush, which is normal and resolves itself automatically within seconds.

✅ Verifying the Flush Worked

Unlike Windows' displaydns command, macOS doesn't offer as convenient a built-in way to directly inspect current cache contents before and after a flush — the most practical verification is simply re-running a lookup for a domain you know recently changed and confirming it now returns the updated, current result.

🖥️ Terminal Basics for This Task

Both flush commands need to be run in the Terminal application, found in Applications > Utilities, or launched quickly via Spotlight search. Type or paste each command, press Return, and enter your administrator password when prompted for sudo — the password won't be visible as you type, which is expected standard terminal behavior rather than an error.

🌐 Network Locations & DNS

macOS supports multiple named "Network Locations," each with its own independent network configuration including DNS settings, and a flush affects the currently active location's cached data — worth being aware of if you regularly switch between configured locations, such as separate home and office setups, since a flush needs to happen while the relevant location is actually active.

📡 Interaction With VPN Clients

A DNS cache flush on macOS can be a useful step immediately after connecting or disconnecting a VPN, since it clears any pre-VPN cached entries that might otherwise continue serving stale results during the transition — see our VPN DNS Leak guide for broader VPN-specific DNS considerations beyond just caching.

📊 Comparison Tables

CommandPurpose
sudo dscacheutil -flushcacheClears the directory service cache
sudo killall -HUP mDNSResponderRestarts mDNSResponder cleanly

🏢 Enterprise Mac Fleet Considerations

IT teams managing a fleet of Mac devices across mixed macOS versions should maintain documentation of the correct flush command for each supported version separately, since a single organization-wide instruction sheet assuming one universal command can quietly fail for users on older or newer releases than the one it was written for.

❌ Common Mistakes

⚠️ Running only dscacheutil without the killall step
Often incomplete on its own for a full, clean flush on current releases.
⚠️ Using an outdated command found in an old forum post
Architecture changes across macOS versions can make old commands ineffective.
⚠️ Not accounting for multiple Network Locations
A flush applies to the currently active location's configuration.

✅ Command Reference Checklist

  • Open Terminal from Applications > Utilities
  • Run sudo dscacheutil -flushcache
  • Run sudo killall -HUP mDNSResponder
  • Re-test the domain in question to confirm the change is visible

🎓 Expert Tips

🗑️
Always Run Both Commands
dscacheutil alone is often not enough for a complete flush on current releases.
🔄
Verify With a Known-Changed Domain
The most practical way to confirm the flush actually took effect.
📚
Confirm Your macOS Version
The correct command can differ from what an older article recommends.

💼 Daily Practical Use Cases

Developers on Mac use this flush routinely after deploying DNS changes to their own projects. Support engineers reference the current correct command when helping Mac users troubleshoot connectivity issues. IT teams managing Mac fleets keep this reference on hand for onboarding and troubleshooting documentation across mixed macOS versions.

📚 Glossary

TermDefinition
mDNSResponderThe macOS process handling DNS caching and Bonjour local discovery
dscacheutilA macOS command-line utility for interacting with directory service caches
Reviewed by: ToolsNovaHub Editorial Team📅 Last updated: August 2026📜 Sourced from: Publicly documented macOS mDNSResponder and dscacheutil behavior

ToolsNovaHub tools are built and independently maintained with a focus on accurate, no-signup network and security utilities. Spotted an error? Let us know.

📋 Related Tools & Guides Comparison

ResourceTypeLink
DNS Cache CheckerToolOpen Tool →
Browser DNS CacheGuideRead Guide →
Windows DNS CacheGuideRead Guide →
Linux DNS CacheGuideRead Guide →
Flush DNS CommandsGuideRead Guide →
Check live DNS cache status — 100% free
🚀 Open DNS Cache Checker

FAQ

The background process responsible for DNS resolution/caching and Bonjour local device discovery.
sudo dscacheutil -flushcache followed by sudo killall -HUP mDNSResponder.
Apple has restructured the underlying DNS caching architecture across macOS versions more than once.
Yes — both commands use sudo and will prompt for your administrator password.
Not exactly — the caching architecture and correct flush command have evolved across releases.
Briefly — restarting mDNSResponder can momentarily interrupt local discovery, resolving itself within seconds.
Re-test a domain you know recently changed and confirm it now returns the updated result.
In Terminal, found in Applications > Utilities, or launched via Spotlight.
Yes — a flush applies to the currently active location's configuration.
It can help, clearing pre-VPN cached entries that might otherwise persist during the transition.

🔗 More Guides