← Back to Learning Hub

DNS • Intermediate • 5 min read

Flush DNS Cache on Mac: Commands for Sonoma, Ventura, Monterey

Flush the DNS cache on any macOS release. Copy the correct dscacheutil and killall mDNSResponder commands for Sonoma, Ventura, Monterey, and older versions.

To flush the DNS cache on a Mac, open Terminal and run two commands together: one that clears the directory services cache and one that restarts the mDNSResponder process. On current macOS releases that is sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. The commands have stayed consistent across Sonoma, Ventura, and Monterey, but older macOS versions used different syntax, and that is exactly where people get stuck. This guide gives the correct command for your release, explains why both parts are needed, and shows how to confirm the flush worked.

Why you flush the DNS cache on a Mac

macOS caches DNS answers to make browsing faster, but a cached record can go stale after you change a site's IP, switch hosts, or edit your local hosts file. Until the cache expires or you clear it, your Mac keeps using the old answer while the rest of the world sees the new one. Flushing forces macOS to discard those cached entries and ask again on the next lookup. It is a safe, routine operation that does not delete any files or settings.

If the record you are chasing recently changed at the DNS level, flushing locally only helps once the change has actually gone live upstream. The DNS propagation troubleshooting guide explains how to tell the difference between a stale local cache and a change that has not propagated yet.

The correct command by macOS release

macOS releaseFlush command
Sonoma (14), Ventura (13), Monterey (12)sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Big Sur (11), Catalina (10.15), Mojave (10.14), High Sierra (10.13), Sierra (10.12)sudo killall -HUP mDNSResponder
El Capitan (10.11), Yosemite (10.10)sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Mavericks (10.9) and earlier 10.9.xdscacheutil -flushcache

As of November 2026, the two-command form shown for Sonoma, Ventura, and Monterey is the one to use on every currently supported Mac. If you are not sure which release you have, open the Apple menu and choose About This Mac to read the version number.

How to flush step by step

  1. Open Terminal. Find it in Applications, then Utilities, or search for it with Spotlight.
  2. Paste the command for your release. Use the two-part command on Sonoma, Ventura, and Monterey.
  3. Press Return and authenticate. Because the command uses sudo, macOS prompts for your administrator password. You will not see characters as you type it; that is normal.
  4. Wait for the prompt to return. A successful flush prints nothing. Getting your prompt back with no error means it worked.
  5. Test a lookup. Visit the affected site or query the record again to confirm your Mac now returns the new value.

Why both commands are needed

On modern macOS, DNS caching is split between two subsystems. The dscacheutil -flushcache part clears the Directory Services cache, while killall -HUP mDNSResponder signals the mDNSResponder process, which handles multicast DNS and much of normal name resolution, to flush its own cache and reload. Running only one leaves the other cache intact, which is why a flush can seem to fail when you use just half of the command. Combining them with a semicolon runs both in sequence from a single line.

When flushing does not fix it

If a site still shows the old address after a clean flush, the cache was probably not the problem. Three things to check: your browser keeps its own DNS cache and may need a restart, the change may not have propagated to your resolver yet, and your router can cache DNS on the whole network. Confirm the authoritative answer with the Valla DNS lookup tool, which queries the real nameservers directly, so you know what value your Mac should be receiving. For a cross-platform reference, the combined guide on flushing DNS on Windows, Mac, and Linux covers the other operating systems.

Frequently asked questions

What is the command to flush DNS on macOS Sonoma?

Open Terminal and run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. The same command works on Ventura and Monterey. Enter your administrator password when prompted, and a silent return to the prompt means it succeeded.

Why does the flush command differ between macOS versions?

Apple has changed how DNS caching is implemented over the years. Several releases relied only on mDNSResponder, while others also use the Directory Services cache, so the correct command depends on which subsystems your macOS version uses to store cached answers.

Do I need admin rights to flush the DNS cache on a Mac?

Yes. The commands use sudo, which requires administrator privileges, because flushing the cache and signaling mDNSResponder are system-level actions. You will be prompted for your password, and the typed characters stay hidden by design.

How do I know the DNS flush actually worked?

A successful flush prints no output and simply returns you to the command prompt. To confirm the effect, load the affected site or re-query the record and check that your Mac now returns the updated value rather than the old one.

My site still shows the old IP after flushing, what now?

The cache likely was not the cause. Restart your browser to clear its separate DNS cache, check whether your router is caching, and confirm the record has actually changed upstream with a direct lookup against the authoritative nameservers.

Not sure what answer your Mac should be getting? Confirm the real value with the Valla DNS lookup tool before you flush again.

Troubleshooting box

If results look inconsistent, compare authoritative nameservers first, then recursive resolvers by region. Capture snapshots every 10 minutes for deterministic incident timelines.

Try VallaDNS free →

Intermediate • 6 min

SSHFP Records: Pin SSH Host Keys in DNS

How SSHFP records publish SSH host-key fingerprints in DNS so clients verify a server on first connect, how to generate them, and why DNSSEC matters here.