Home › Mac 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.
dscacheutil -flushcacheclears the Directory Service cache, a general-purpose lookup cache that includes host entries.killall -HUP mDNSRespondersends a hangup signal to mDNSResponder, the daemon that actually performs DNS resolution and Bonjour discovery on macOS. It does not kill it permanently; launchd restarts it immediately with an empty cache.
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
| Command | Applies to | Status today |
|---|---|---|
lookupd -flushcache | Mac OS X 10.5 and earlier | Command no longer exists |
dscacheutil -flushcache alone | 10.6 era | Incomplete on modern macOS |
discoveryutil mdnsflushcache | 10.10 only | discoveryutil was removed |
killall -HUP mDNSResponder alone | Most versions | Works, but pair it with dscacheutil |
Verifying that it worked
Since the flush prints nothing, check the result rather than the command. Two useful tools:
dig example.comqueries your configured resolver directly and shows the answer plus TTL. Note thatdigandnslookupbypass the system cache entirely, so they always show the fresh upstream answer.dscacheutil -q host -a name example.comgoes through the system resolver, which is what your apps actually use. This is the one that reflects the cache you just flushed.
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:
- Your browser has its own DNS cache. Chrome exposes it at
chrome://net-internals/#dnswith a Clear host cache button. Restarting the browser also clears it. - Your router caches DNS. Most home routers run their own resolver. Reboot it, or check its admin page for a flush option.
- 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.
- A VPN or custom DNS is intercepting. VPN clients often install their own resolver. Disconnect and retest.
- The
/etc/hostsfile has an override. Check it withcat /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. - 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
- One specific site fails to load while everything else is fine.
- You moved a domain to a new host and still reach the old server.
- Pages hang for several seconds before starting to load, then load quickly.
- A local development hostname or
.localBonjour name stops resolving. - Errors mentioning server not found or address could not be resolved after a network change.
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.
Related maintenance commands worth knowing
DNS flushing usually comes up as part of a wider troubleshooting session. The other commands in the same family are:
killall Finderandkillall Dockrestart those processes, clearing UI glitches such as icons that will not refresh.qlmanage -r cacherebuilds the Quick Look thumbnail cache when previews show the wrong content.atsutil databases -removeclears font caches, for garbled text or missing fonts. Log out and back in afterwards.sudo mdutil -E /erases and rebuilds the Spotlight index when search returns nothing or stale results. Expect high CPU for a while as it reindexes.
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 daysmacOS 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.