delete dns cache mac refers to clearing the local DNS resolver cache on macOS using Terminal commands dscacheutil and killall to force fresh DNS lookups.
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
This two‑command sequence flushes both the Directory Services cache and the mDNSResponder daemon cache. Run it when DNS changes (hosting migration, record updates) do not reflect after propagation.
When to flush the DNS cache
Stale cache causes site unreachable errors, outdated content, or misdirected traffic. Typical triggers:
- After changing a domain’s A/AAAA records
- After switching hosting providers
- After reconnecting a VPN that changes nameservers
- When a site that worked earlier now shows “server not found”
How to flush DNS cache on any modern macOS
- Open Terminal from Applications → Utilities.
- Execute the following command and enter your admin password when prompted:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderNo output signals success.
- Optional: verify with
dig example.com +shortto confirm the old IP is gone.
Common errors
- “Operation not permitted” – Ensure you use
sudoand have admin privileges. Runsudo -vto refresh credentials. - “No matching processes” – mDNSResponder is not running. Restart it:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist. - “dscacheutil: invalid option” – The
-flushcacheflag requires macOS 10.7+. On older systems (10.5/10.6) usesudo lookupd -flushcache. - Password not accepted – Verify your password or check sudoers restrictions.
- Still seeing old IP after flush – The TTL may not have expired globally, or a secondary cache (browser, router) persists. Clear browser cache and check DNS propagation.
- System feels slower after flush – Temporary; performance returns as new entries populate.
Version history
The sudo killall -HUP mDNSResponder command works on macOS 10.9 and later. On macOS 10.10 and earlier, some guides mention sudo discoveryutil mdnsflushcache, but that is deprecated. The command above is universal for modern releases (macOS 10.11+, including macOS Ventura, Sonoma, Sequoia).
Frequently Asked Questions
What is the difference between dscacheutil -flushcache and sudo killall -HUP mDNSResponder?
Answer: Both flush the DNS cache; dscacheutil -flushcache clears system cache entries, while killall -HUP sends a hangup signal to mDNSResponder, forcing it to reload its configuration and clear its cache. For complete clearance, run both consecutively.
sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder
When should I use sudo killall -HUP mDNSResponder over dscacheutil -flushcache?
Answer: Use sudo killall -HUP mDNSResponder when standard flush fails, DNS resolution issues persist after dscacheutil -flushcache, or after VPN reconnect or interface changes. The signal forces a daemon restart, clearing entries that dscacheutil might miss.
sudo killall -HUP mDNSResponder
How do I fix “Permission denied” when running dscacheutil -flushcache on macOS?
Answer: Prepend sudo to gain root privileges: sudo dscacheutil -flushcache.
sudo dscacheutil -flushcache
Does dscacheutil -flushcache work on macOS Sonoma (14.x) and Sequoia (15.x)?
Answer: Yes, dscacheutil -flushcache works on all modern macOS versions including Sonoma and Sequoia. Apple consistently supports it. For older versions (10.9–10.11), sudo killall -HUP mDNSResponder remains the primary fallback.
# macOS 10.12+ (including Sonoma, Sequoia)
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
What is the fastest way to delete DNS cache on macOS from the command line?
Answer: Execute sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder in one line. This guarantees a full flush without waiting.
sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder

Command Line Expert & Software Engineer
Welcome! I’m Thomas Heinrich, a software engineer and system administrator with a deep passion for the Command Line Interface (CLI). With years of experience navigating the terminal, building backend architectures, and automating server deployments, I created this space to share practical, real-world terminal knowledge.
Whether you are a beginner taking your first steps in a Linux environment or a seasoned DevOps engineer looking to optimize your deployment scripts, you will find actionable solutions here. My goal is to help you ditch the mouse, speed up your workflow, and harness the full power of the command line.