How to Flush the DNS Cache on a Mac (and When You Need To)
Quick answer: To flush the DNS cache on a Mac, open Terminal and run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder, then enter your administrator password. Nothing is printed when it works. Flushing makes the Mac look up website addresses again and frees no disk space.
How do I flush the DNS cache on a Mac?
Open Terminal, run the command below and enter your administrator password. Community guides list it for current macOS releases, it prints nothing when it works, and no restart is needed afterwards.
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderThe first part, dscacheutil -flushcache, clears the Directory Service cache. The second part, killall -HUP mDNSResponder, signals the macOS DNS responder to drop its stored answers. Terminal hides password characters as you type, so press Return when finished.
Which flush command works on which macOS version?
Current macOS releases use the two-part command above, while Yosemite 10.10 to 10.10.3 and Snow Leopard 10.6 differ. The table lists each version group with the command community guides give for it.
| macOS or OS X version | Command | How well sourced |
| 10.10.4 Yosemite and later, up to current macOS | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder | Two community guides; the killall part alone is also given for 10.10.4 to Big Sur |
| 10.10 to 10.10.3 Yosemite | sudo discoveryutil mdnsflushcache | One guide; others give udnsflushcaches |
| 10.7 to 10.9 Lion, Mountain Lion, Mavericks | sudo killall -HUP mDNSResponder | Several guides agree |
| 10.6 Snow Leopard | sudo dscacheutil -flushcache | Several guides agree |
Apple publishes no current support article for this command that we could find, so the table rests on community guides that agree with each other. Several copied commands use an en dash in place of a hyphen, which fails when pasted into Terminal.
How can I check that the flush worked?
The flush command prints nothing on success. To check, ask macOS to resolve a name and compare the answer with a direct query to a DNS server, which bypasses the local cache.
dscacheutil -q host -a name example.com
dig example.com +shortThe first command asks the system resolver, the same path Safari uses. The second asks your configured DNS server directly. If the two addresses differ after a flush, the stale answer is somewhere other than your Mac.
Do Chrome and Firefox keep their own DNS cache?
Chrome keeps its own host cache, separate from macOS, so a Terminal flush does not clear it. Firefox also caches lookups in memory, and quitting and reopening either browser clears that copy.
In Chrome, open chrome://net-internals/#dns and click Clear host cache. Restart the browser if the site still fails. Safari looks names up through macOS, so the Terminal command covers it.
When should I flush the DNS cache?
Flush the DNS cache when a site fails on your Mac but loads on your phone using mobile data, after changing DNS servers or networks, or after a website moves to a new server.
Site works on mobile data, not on the Mac. The Mac may be holding an old address.
You changed DNS servers or a VPN. Old answers can linger until they expire.
You edited the hosts file. A flush makes sure the new entry is used.
A site you run changed hosting. Your own Mac may still point at the old server.
What does flushing the DNS cache not fix?
Flushing clears stored website addresses and nothing else. It does not fix a 404 error, speed up a slow Mac, free disk space, or hide which sites you visit from your internet provider.
A 404 comes from the website, not from your Mac. Your provider and DNS server still see each lookup after a flush. The table shows how common problems map to the right fix.
| Situation | Flush DNS? |
|---|---|
| Site works on phone but not on Mac | Yes |
| You changed DNS servers | Yes |
| A site recently moved hosts | Yes |
| Mac feels slow | No, see the slow Mac guide |
| Disk is full | No, it frees no space |
Why does a site still fail after I flush DNS?
Something other than the Mac cache is answering the lookup. The hosts file, a VPN, iCloud Private Relay or the router can each override or repeat a stale address.
The hosts file. Entries in /etc/hosts take priority over DNS. Run cat /etc/hosts in Terminal to look. A line pointing a site at the wrong address keeps it broken.
A VPN or proxy. These can use their own DNS servers, so test with the VPN switched off.
iCloud Private Relay. Private Relay changes how Safari traffic is routed, so turn it off for the network if one site fails only in Safari.
Router or provider DNS. If other devices on the same network fail the same way, the cached answer is on the router.
How do I see which DNS servers my Mac is using?
Run scutil --dns in Terminal and filter for nameserver lines. Each line is a DNS server address the Mac can ask, and the first entries are usually the ones used for most lookups.
scutil --dns | grep nameserverA private address such as 192.168.1.1 usually means the router passes lookups on to your provider. A public address means the Mac asks that resolver directly. Knowing which is in use shows where a stale answer could come from.
How do I ask a specific DNS server directly?
Ask a named server for the same address with nslookup or dig. If that server returns the right address but your normal lookup does not, the fault is in your configured DNS server.
nslookup example.com 1.1.1.1
dig @1.1.1.1 example.com +shortThe last part of each command is the server to ask. If the answers differ, switch to another server in System Settings ▸ Network ▸ your connection ▸ Details ▸ DNS.
What should I try if the site still does not load?
Work through the steps in order: reconnect to the network, check the DNS servers, restart the router, and clear the browser cache. Each step rules out one layer between the Mac and the website.
Turn Wi-Fi off and on, or reconnect to the network.
Check the DNS servers in System Settings ▸ Network ▸ your connection ▸ Details ▸ DNS, and try a different public resolver.
Restart your router.
Clear the browser cache. See How to Clear Cache on a Mac (App, Browser and DNS Cache).
How does a DNS lookup travel from my Mac to a website?
A lookup passes through up to four caches before an answer arrives: the browser, macOS, the router and the DNS server. The Terminal flush clears only the macOS layer.
What is the DNS cache?
The DNS cache is the Mac memory of recent website-name lookups. It speeds up browsing by skipping repeat questions, and flushing it is only worth doing when a stored answer has gone stale.
Every website name has to be turned into a numeric address before the Mac can connect. macOS remembers recent answers for a while, which makes browsing faster and is almost always right.
FAQs
Does flushing DNS delete anything?
No. Flushing clears only stored website addresses. Files, browsing history, passwords and saved logins are untouched, and the Mac rebuilds the cache as you browse.
Will flushing DNS speed up my Mac?
Not in general. Flushing can fix lookups that fail or return old addresses, but a Mac that feels slow usually has a storage, memory or startup-item cause instead.
Does flushing DNS free disk space?
No. The DNS cache lives in memory and is tiny, so flushing frees no storage. For disk space see Mac Storage Full? A Complete Guide to Finding and Freeing Up Space.
Do I need to restart after flushing the DNS cache?
No. The change takes effect immediately for apps that use the system resolver. Browsers with their own cache, such as Chrome, need their own clear or a restart.
Is it safe to flush the DNS cache?
Yes. Flushing only discards stored answers, and the Mac asks the DNS server again the next time a site is visited. The command needs an administrator password but changes no settings.
How often should I flush the DNS cache?
Only when a lookup problem appears. There is no benefit to flushing on a schedule, because stored answers expire on their own and a fresh cache simply slows the first visit to each site.
Does flushing DNS stop DNS spoofing?
A flush removes a poisoned entry already stored on the Mac, but it does not prevent spoofing. Encrypted DNS settings and a trusted resolver are what reduce that risk.
Why does Terminal show nothing when I type my password?
Terminal hides password characters on purpose. Type the administrator password, press Return, and the command runs even though no dots or letters appear while typing.
Sources
Marc Abramowitz, Flushing the DNS cache on macOS (2026): the two-part command and what each part does.
SimpleHelp, How to clear the DNS cache in all versions of OS X or macOS: commands by version.
freeCodeCamp, How to flush DNS on Mac.
