Caches, logs & temp files

How to Flush the DNS Cache on Mac (Every macOS Version)

If a website suddenly becomes unreachable, loads the wrong page, or your Mac keeps hitting a domain that you know has moved, a stale DNS cache is usually the culprit. Knowing how to flush the DNS cache on Mac takes about ten seconds once you have the right command — but the command has changed across macOS versions, which is where most guides go wrong. This article gives you the exact command for every supported release, explains what flushing actually fixes, and shows you how to confirm it worked.

What Is the DNS Cache and Why Does It Go Stale?

When you type a domain name into a browser, your Mac asks a DNS resolver to turn that name into an IP address. macOS caches the result locally so the same lookup does not have to travel to a remote server every single time. That is normally a good thing — pages load faster and your router handles less traffic.

The problem is that cached records have a Time-To-Live (TTL) set by the domain owner, but macOS does not always respect short TTLs perfectly. When a site moves to a new server, when you switch networks, or after a VPN session ends, you can end up with a stale record that points nowhere useful. Flushing the cache forces macOS to ask the resolver fresh questions.

Common symptoms a DNS flush fixes

  • Safari or Chrome says "This site can't be reached" for a domain that works fine on your phone.
  • A site you just updated still loads an old IP address.
  • A local development domain (like app.test) keeps resolving to the wrong address after you changed /etc/hosts.
  • Intermittent failures to connect right after switching from Wi-Fi to Ethernet or VPN.

DNS flushing does not fix slow general performance, high disk usage, login problems, or app crashes — those are separate issues.

The Exact Command to Flush DNS Cache on Mac (by macOS Version)

Apple has changed the underlying DNS service multiple times. Use the table below to find your release, then run the matching command in Terminal (Applications → Utilities → Terminal).

macOS Version Release Name Command
15 Sequoia sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
14 Sonoma sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
13 Ventura sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
12 Monterey sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
11 Big Sur sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
10.15 Catalina sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

The command has been stable since macOS 10.12 Sierra. If you are running macOS 16 or a future release after August 2025, the same two-part command is almost certainly still correct — Apple has not changed the DNS stack in any macOS since Sierra.

Step-by-Step: How to Flush the DNS Cache on Mac

  1. Open Terminal. You can press Command + Space, type Terminal, and press Return.
  2. Type or paste the following command exactly as shown:
    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  3. Press Return. macOS will prompt for your administrator password. Type it and press Return again. The password field stays blank while you type — that is normal.
  4. The Terminal returns to a prompt with no output. That silence means it worked. There is no confirmation message.
  5. Switch back to your browser and reload the page.

What each part of the command does

  • sudo dscacheutil -flushcache — clears the Directory Services cache, which includes the DNS lookups macOS has stored through its higher-level caching layer.
  • sudo killall -HUP mDNSResponder — sends a "reload" signal to the mDNSResponder daemon, which is the actual DNS resolver process. This flushes its internal cache and forces a clean restart without stopping the process entirely.

You need both commands together. Running only dscacheutil often leaves the resolver's own cache intact; running only killall -HUP mDNSResponder can miss the directory-services layer.

How to Verify the Flush Worked

macOS gives no success message, so here are two ways to confirm the cache is empty.

Option 1 — Console log

  1. Open the Console app (Applications → Utilities → Console).
  2. In the search bar type mDNSResponder and start a live stream.
  3. Run the flush command in Terminal.
  4. You should see lines like "DNS cache flushed" appear in Console within a second or two.

Option 2 — Run a fresh lookup

  1. In Terminal, run:
    dscacheutil -q host -a name example.com
  2. Note the IP address returned.
  3. Run the flush command, then repeat the query. If the IP changed (because the record was stale) or the response time jumped briefly (because the cache was empty), the flush worked.

What Flushing DNS Does Not Do

It is worth being clear about the scope here. Flushing DNS only clears name-resolution records. It does not:

  • Clear your browser's own DNS cache (Chrome and Firefox maintain separate caches — visit chrome://net-internals/#dns or about:networking#dns to clear those).
  • Free up disk space or remove system caches in ~/Library/Caches or /Library/Caches.
  • Fix slow general Mac performance caused by accumulated logs, old update files, or purgeable System Data.
  • Remove leftover files from uninstalled apps.

If you are also seeing sluggish performance or your disk is nearly full, those are separate problems. Crumb handles the disk side — caches, logs, temp files, and app leftovers — without touching your network settings. DNS flushing and a disk clean-up are independent operations that do not interfere with each other.

Is It Safe to Flush DNS on Mac?

Yes, completely. The DNS cache is rebuilt automatically the next time you visit any site. You will not lose any data, credentials, or settings. The only observable effect is that the first DNS lookup after a flush takes a fraction of a second longer than usual while the cache repopulates — not noticeable in practice.

The sudo prefix does require administrator privileges, but the commands only signal the DNS responder to reload. They do not delete files, modify configuration, or make any persistent changes to your system.

Resetting DNS Cache on macOS: Quick Recap

  • Command (macOS 12–15 and later): sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  • When to use it: unreachable sites that work elsewhere, stale records after a server migration, wrong resolution after editing /etc/hosts.
  • When it won't help: slow app launches, high disk usage, login issues, browser-specific problems (clear the browser cache separately).
  • Risk level: None. The cache rebuilds itself automatically.

That is everything you need to clear the DNS cache on Mac. For disk-level housekeeping that DNS flushing cannot touch — system caches, log files, and app leftovers — you can download Crumb and run a free one-click clean.

Reclaim your disk in one click

Crumb audits your whole Mac, tells you what's safe to delete, and frees the space in seconds — private, local, and Apple-notarized.

Download Crumb for macOS

Frequently asked questions

What is the command to flush DNS cache on Mac?
Run this in Terminal: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder — it works on macOS Monterey, Ventura, Sonoma, and Sequoia.
Do I need to restart my Mac after flushing the DNS cache?
No. The DNS cache is cleared immediately when you run the command. No restart is needed.
Why does Terminal show no output after the DNS flush command?
macOS does not print a success message for these commands. Silence means it worked. You can verify using the Console app or by running a fresh dscacheutil query.
Will flushing the DNS cache delete any important data?
No. The DNS cache only stores temporary name-to-IP mappings. It rebuilds itself automatically as you browse, and flushing it does not affect any files, settings, or credentials.
Does flushing DNS cache fix slow Mac performance or free up disk space?
No. DNS flushing only clears name-resolution records. Slow performance or low disk space is caused by accumulated caches, logs, and app leftovers — a separate problem that a disk cleaner addresses.