HomeMac Guides › Flush DNS Cache

How to flush the DNS cache on your Mac

When a website will not load in any browser, or a domain you just pointed at a new server still resolves to the old one, the culprit is often your Mac's DNS cache holding a stale answer. Flushing it takes one command and a few seconds. The tricky part is that the internet is full of outdated instructions for macOS versions nobody runs any more, so here is the correct command, what it does, and what to check when it does not help.

Updated 2026-08-02 · Written by the CleanerMac team · macOS 13–15 tested

The command that works on every current macOS

Open Terminal (Applications, Utilities, or Command-Space and type Terminal) and run:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

You will be prompted for your administrator password. Nothing is printed on success, which is normal and often mistaken for failure. This single line is correct for macOS Sequoia, Sonoma, Ventura and every version back to El Capitan, so it is the only one you need to remember.

Why it is two commands

The two halves do different jobs, which is why so many guides that give only one of them produce inconsistent results.

Running both covers every layer where a stale record could be sitting. On some macOS releases you may also see mDNSResponderHelper mentioned; you do not need to signal it separately.

Commands you will find online that you should ignore

CommandApplies toStatus today
lookupd -flushcacheMac OS X 10.5 and earlierCommand no longer exists
dscacheutil -flushcache alone10.6 eraIncomplete on modern macOS
discoveryutil mdnsflushcache10.10 onlydiscoveryutil was removed
killall -HUP mDNSResponder aloneMost versionsWorks, but pair it with dscacheutil

Verifying that it worked

Since the flush prints nothing, check the result rather than the command. Two useful tools:

If the two disagree, something is still holding an old answer, and the next section covers where.

When flushing does not fix it

The system cache is only one of several places a stale record can hide. Work through these in order:

  1. Your browser has its own DNS cache. Chrome exposes it at chrome://net-internals/#dns with a Clear host cache button. Restarting the browser also clears it.
  2. Your router caches DNS. Most home routers run their own resolver. Reboot it, or check its admin page for a flush option.
  3. The record genuinely has not propagated. If you just changed a DNS record, the old value can persist for as long as its TTL at every resolver between you and the authoritative server. Nothing you do locally shortens that.
  4. A VPN or custom DNS is intercepting. VPN clients often install their own resolver. Disconnect and retest.
  5. The /etc/hosts file has an override. Check it with cat /etc/hosts. Entries here beat DNS entirely, and a line left over from an old development setup is a classic cause of one site refusing to load.
  6. Your ISP resolver is the stale one. Test by pointing System Settings, Network, your connection, Details, DNS at 1.1.1.1 or 8.8.8.8 temporarily.

Symptoms a DNS flush actually fixes

If instead a page loads but looks wrong or shows outdated content, DNS is not your problem and you want to clear the Safari cache or the Chrome cache instead.

Doing it without Terminal

Nothing here is dangerous, but typing a sudo command is not everyone's idea of a good time, and it is easy to paste the wrong variant from an old forum post. CleanerMac's Tune-Up tab includes Flush DNS as a single button that runs exactly the command above, alongside the other maintenance actions people otherwise keep in a notes file: purge inactive memory, restart Finder and the Dock, reset Quick Look and clear font caches.

DNS flushing usually comes up as part of a wider troubleshooting session. The other commands in the same family are:

These appear again in our Mac maintenance checklist and in the guide to speeding up a slow Mac, which covers the disk and memory side of the same problem.

How often should you flush DNS?

Only when you have a reason. DNS caching exists to make browsing faster, and flushing it on a schedule just adds latency to your next few lookups for no benefit. Treat it as a troubleshooting step, not a maintenance habit.

Skip the Terminal commands

Flush DNS, free RAM and reset caches with one tap.

Download CleanerMac — free for 3 days

macOS 13+ · Apple Silicon & Intel · $24.99 once, no subscription

Frequently asked questions

What is the command to flush DNS cache on a Mac?

Run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder in Terminal and enter your administrator password. This works on macOS Sequoia, Sonoma, Ventura and every version back to El Capitan. It prints nothing on success.

Why does the flush command produce no output?

Both commands are silent by design when they succeed. To confirm the cache is clear, run dscacheutil -q host -a name example.com and check that the answer matches what dig example.com returns.

Do I need to restart my Mac after flushing DNS?

No. The killall -HUP part signals mDNSResponder to reload, and launchd restarts it instantly with an empty cache. The change takes effect immediately, though your browser may still hold its own separate cache.

I flushed DNS and the site still will not load. What now?

Check your browser's own DNS cache, reboot your router, and look at /etc/hosts for a leftover override. If you recently changed a DNS record, the old value can persist upstream until its TTL expires, which nothing local can shorten.

Is flushing the DNS cache safe?

Yes. It only discards cached lookup results, which are rebuilt automatically the next time you visit a site. Nothing is permanently deleted and no settings change. The only cost is slightly slower first lookups afterwards.

Can I flush DNS without using Terminal?

Yes. CleanerMac's Tune-Up tab runs the same command as a single button, along with other common maintenance actions such as purging inactive memory and restarting Finder and the Dock.