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 password. Nothing is printed when it works. It makes your Mac look up website addresses again. It does not free up disk space.
Flush the DNS cache when a site will not load on your Mac but works on your phone, after changing DNS settings or networks, or when a site has moved servers.
The command
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderThe first part clears the directory-service cache and the second restarts the DNS responder. You will be asked for an administrator password, and nothing appears as you type.
Check that it worked
The command prints nothing on success. To test, try loading the site again, or look up a name:
dscacheutil -q host -a name example.comThe lookup returns a fresh address from your current DNS server.
Clear the browser's own DNS cache
Chrome keeps its own host cache. In Chrome, open chrome://net-internals/#dns and click Clear host cache. Restart the browser if the site still fails.
If it still does not load
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).
| 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 |
FAQs
Does flushing DNS delete anything?
No. It only clears stored website addresses.
Will flushing DNS speed up my Mac?
Not generally. It can fix lookups that fail or return old addresses.
Does flushing DNS free disk space?
No. For disk space see Mac Storage Full? A Complete Guide to Finding and Freeing Up Space.