Flush DNS on Mac: Command for Sequoia, Sonoma & Tahoe (2026)
Flush DNS on Mac with sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder. Covers Sequoia, Sonoma, Ventura, Chrome cache, and links to the Tahoe guide.
Sleezr Team

Table of Contents
- Quick answer: macOS flush DNS command for 2026
- Clear Chrome DNS cache on Mac
- What is DNS cache?
- The role of DNS cache
- When to flush DNS cache
- Commands by macOS version
- macOS Tahoe, Sequoia, Sonoma, Ventura, Monterey (26.x, 15.x, 14.x, 13.x, 12.x)
- macOS Big Sur (11.x)
- macOS Catalina, Mojave, High Sierra (10.15, 10.14, 10.13)
- macOS Sierra, El Capitan (10.12, 10.11)
- OS X Yosemite (10.10)
- Running the command step by step
- Step 1: Open Terminal
- Step 2: Run the command
- Step 3: Enter your password
- Step 4: Verify success
- Why hosts changes don't work without flush
- DNS resolution order
- Automating DNS flush
- Create a Terminal alias
- Automated shell script
- With Sleezr (automatic)
- Also flush browser cache
- Chrome
- Firefox
- Safari
- Troubleshooting
- "Operation not permitted"
- "No matching processes"
- Changes still not taking effect
- Best practices
- Create a routine
- Use appropriate TLDs
- Conclusion
- Sources and further reading
Need the Mac flush DNS command right now? For current macOS versions, open Terminal and run:
sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponderThis is the command to clear DNS cache on macOS Sequoia, Sonoma, Ventura, Monterey, Big Sur and most modern releases. On macOS 26 Tahoe, use the same command — see the dedicated macOS 26 Tahoe flush DNS guide for verification and browser quirks. Sequoia 15 uses this same parent command (covered in the version table below).
You've modified your hosts file but the changes aren't taking effect? The culprit is almost always DNS cache. In this guide, we'll see how to flush DNS cache on Mac, which command to use by macOS version, how to verify the result, and how to automate this repetitive task.
Quick answer: macOS flush DNS command for 2026
For the latest macOS versions in 2026, use this command:
sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponderIt is safe to run when you need to refresh local DNS resolution. macOS does not print a success message, so returning to the prompt without an error usually means the DNS cache was cleared.
- Tahoe 26, Sequoia 15, Sonoma 14, Ventura 13, Monterey 12, Big Sur 11:
sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder - Catalina 10.15, Mojave 10.14, High Sierra 10.13, Sierra 10.12:
sudo killall -HUP mDNSResponder - El Capitan 10.11:
sudo killall -HUP mDNSResponder - Yosemite 10.10:
sudo discoveryutil mdnsflushcache && sudo discoveryutil udnsflushcaches
If the issue is in Chrome, Firefox or Safari, also clear the browser DNS cache after the system command.
Clear Chrome DNS cache on Mac
chrome://net-internals/#dns in Chromechrome://net-internals/#sockets and click Flush socket poolsOn Windows use ipconfig /flushdns. On Linux see flush DNS on Linux.
What is DNS cache?
The role of DNS cache
Every time you visit a website, your Mac must resolve the domain name (like google.com) to an IP address. To speed up this process, macOS maintains a local cache of recent DNS resolutions.
This cache avoids contacting DNS servers for every request, which improves browsing speed. However, it can become an obstacle when:
- You modify the hosts file
- A site changes IP address
- You're testing DNS configurations
- You switch between development environments
When to flush DNS cache
Common situations requiring a DNS flush:
- After any modification to /etc/hosts (see our guide to edit the hosts file)
- After a DNS server change
- When a site "doesn't work" for no apparent reason
- During server migration testing
- To resolve "DNS_PROBE_FINISHED_NXDOMAIN" errors
Commands by macOS version
The exact command varies slightly depending on your macOS version.
macOS Tahoe, Sequoia, Sonoma, Ventura, Monterey (26.x, 15.x, 14.x, 13.x, 12.x)
sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponderThis command combines two actions:
dscacheutil -flushcache: Flushes the Directory Service DNS cachekillall -HUP mDNSResponder: Restarts the mDNS daemon
This is also the best command to try for "macOS flush DNS cache command 2026" queries because Apple has kept mDNSResponder as the resolver service across current macOS versions. On macOS Tahoe 26 specifically, see the dedicated Tahoe flush DNS guide.
macOS Big Sur (11.x)
sudo dscacheutil -flushcache && sudo killall -HUP mDNSRespondermacOS Catalina, Mojave, High Sierra (10.15, 10.14, 10.13)
sudo killall -HUP mDNSRespondermacOS Sierra, El Capitan (10.12, 10.11)
sudo killall -HUP mDNSResponderOS X Yosemite (10.10)
sudo discoveryutil mdnsflushcache && sudo discoveryutil udnsflushcachesTip: To find your macOS version, click the Apple menu () > About This Mac.
Running the command step by step
Step 1: Open Terminal
- Press Cmd + Space to open Spotlight
- Type "Terminal"
- Press Enter
Step 2: Run the command
For macOS Monterey and later:
sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponderStep 3: Enter your password
Terminal displays Password:. Type your administrator password (nothing appears) and press Enter.
Step 4: Verify success
If the command succeeds, you simply return to the command prompt with no error message.
To verify, test with ping:
ping myproject.localWhy hosts changes don't work without flush
DNS resolution order
When you type a domain in your browser:
If the domain is already in system cache (step 2), the hosts file (step 3) is never consulted!
Automating DNS flush
Create a Terminal alias
Add this line to your ~/.zshrc file:
alias flushdns="sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder && echo 'DNS cache flushed'"Reload your configuration:
source ~/.zshrcNow, simply type flushdns in Terminal.
Automated shell script
Create a flush-dns.sh file:
#!/bin/bash
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
echo "DNS cache flushed successfully"Make it executable:
chmod +x flush-dns.shWith Sleezr (automatic)
The Sleezr app integrates DNS flushing automatically. Every time you modify a hosts entry, DNS cache is flushed without additional action. This is useful if you switch between local, staging and production mappings several times a day.
Also flush browser cache
System DNS flush doesn't clear browser cache.
Chrome
chrome://net-internals/#dnsFirefox
about:networking#dnsSafari
Develop menu > Empty Caches (Cmd + Option + E)
Troubleshooting
"Operation not permitted"
Cause: Insufficient permissions.
Solution: Use sudo and verify your account is an administrator.
"No matching processes"
Cause: The mDNSResponder process isn't running.
Solution: Restart it:
sudo launchctl kickstart -k system/com.apple.mDNSResponderChanges still not taking effect
Check:
Best practices
Create a routine
After each hosts file modification:
Use appropriate TLDs
- .test: Recommended
- .localhost: Always local
- .local: Can conflict with Bonjour
Conclusion
Flushing DNS cache on Mac is a simple but essential operation. The command sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder should be part of your daily toolkit.
To eliminate this friction, tools like Sleezr automate DNS flushing with every modification, allowing you to focus on your code.
Sources and further reading
- How DNS works (Cloudflare Learning)
- Terminal User Guide (Apple Support)
- The hosts file explained (Wikipedia)
Frequently Asked Questions
How do I flush DNS cache on Mac?
Open Terminal and run: sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder. Enter your administrator password when prompted.
Why do I need to flush DNS cache?
DNS cache temporarily stores domain/IP associations. After modifying the hosts file or a DNS change, flushing the cache forces your Mac to use the new values.
Is the flush DNS command different for each macOS version?
Slightly. Since macOS Sierra (10.12), the standard command is: sudo killall -HUP mDNSResponder. For older versions, different commands are needed.
How do I know if the DNS flush worked?
Use the ping command with the affected domain to verify that the new IP address is being resolved.
Can I automate DNS flushing?
Yes, create an alias in your .zshrc file or use a tool like Sleezr that integrates DNS flushing automatically.
How do I clear DNS cache in Chrome on Mac?
Open chrome://net-internals/#dns and click Clear host cache, then flush macOS DNS with sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder.
Why does my Mac still resolve the old IP after flushing DNS?
A browser host cache, an active VPN resolver, or a hosts file syntax error can override the flush. Clear the browser cache, disable VPN DNS, and double-check /etc/hosts.
Related Articles
Flush DNS on Windows 10 & 11: ipconfig /flushdns (2026)
Flush the DNS cache on Windows 10 and 11 with ipconfig /flushdns. Step-by-step command, verification, and fixes when changes still do not apply.
Sleezr Team
Developer tools team
Flush DNS on Linux: systemd-resolved & more (2026)
Flush the DNS cache on Linux with resolvectl flush-caches (systemd-resolved), plus nscd, dnsmasq and BIND. Commands by setup, with verification steps.
Sleezr Team
Developer tools team
macOS 26 Tahoe: Flush DNS Cache Command (2026)
Flush DNS cache on macOS 26 Tahoe with the exact Terminal command, verification steps, browser cache checks, and hosts file troubleshooting.
Sleezr Team
Developer tools team
Hosts File: Location, Syntax and Uses (2026)
Learn what the hosts file does, where to find it on Mac, Windows and Linux, syntax examples, local dev uses and mistakes to avoid.
Sleezr Team
Which TLD to Use for Local Development (.test vs .localhost)
Which TLD to use for local development: prefer .test, avoid .dev and .local. Why .test is reserved, how to map it in the hosts file, and HTTPS tips.
Sleezr Team
Developer tools team