sodcalculator

10 Tech How-To

How to Flush DNS Cache in macOS Catalina

Guide 10-22289 · Updated · Step by step

If you’re seeing outdated websites, connection errors, or DNS resolution issues on your Mac running Catalina, flushing the DNS cache can often fix the problem. This guide shows you the exact commands to clear the DNS cache in macOS Catalina, what to do if the standard command doesn’t work, and how to verify the flush succeeded.

What You’ll Need

  • A Mac running macOS Catalina (10.15)
  • Administrator (admin) access – you’ll need to enter your password
  • Terminal app (found in /Applications/Utilities/)

Step-by-Step

  1. Open Terminal. Go to Finder > Applications > Utilities > Terminal. You can also press Cmd+Space, type “Terminal”, and hit Return.
  2. Run the DNS flush command. Type the following command exactly, then press Return:
    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
    You’ll be prompted for your admin password. Type it (it won’t show on screen) and press Return.
  3. Wait for the command to finish. It usually completes in a few seconds. If you see no output, that’s normal – success is silent.
  4. Verify the flush (optional). To confirm the DNS cache was cleared, run:
    sudo dscacheutil -cachedump -entries Host
    If the output shows No cache entries or is empty, the cache is cleared.
  5. Test your internet connection. Open a web browser and visit a few sites you had trouble with. If they load correctly, the flush worked.

Common Mistakes

  • Using the wrong command for your macOS version. Commands like killall -HUP mDNSResponder alone (without dscacheutil) work on newer macOS, but on Catalina you need both parts. Using the older lookupd command won’t work.
  • Forgetting sudo. The command requires root privileges. Without sudo, you’ll get a “permission denied” error.
  • Typing the command incorrectly. Ensure there’s a space between dscacheutil and -flushcache, and a semicolon (;) between the two commands. Copy-paste the command to avoid typos.
  • Not restarting your browser. After flushing, close and reopen your browser (or at least clear its internal cache) to see the effect.

Tips

  • If you’re using a VPN or a proxy, flush the DNS cache after disconnecting or reconnecting, as these can leave stale entries.
  • You can also reset the DNS cache by restarting your Mac, but the command above is faster and less disruptive.
  • If you’re troubleshooting a specific site, try using a different DNS server (like Google’s 8.8.8.8) after flushing to rule out your ISP’s DNS issues.
  • Keep your macOS updated – later versions may change the flush command, but Catalina’s is stable.

Troubleshooting

If the command doesn’t work or you still see issues:

  • Check for typos. Re-type the command carefully, or copy-paste it from this guide.
  • Make sure you’re using the right Terminal. If you’re in a different shell (like zsh), the command still works – it’s the same syntax.
  • Try a different command. On some Catalina versions, you can also try:
    sudo killall -HUP mDNSResponder; sudo dscacheutil -flushcache
    (note the order swapped). Both should work, but if one fails, try the other.
  • Check if mDNSResponder is running. Run ps aux | grep mDNSResponder. If it’s not running, the killall command will fail – restart your Mac to restart the service.
  • If the issue persists, restart your Mac. A full restart clears all system caches, including DNS, and often resolves stubborn problems.
  • Reset your router. Sometimes the DNS cache is on your router, not your Mac. Power-cycle your router and try again.

Frequently Asked Questions

Why do I need to flush the DNS cache?

Your Mac stores DNS lookups to speed up browsing. If a website’s IP address changes, the cached old address can cause errors. Flushing forces your Mac to fetch fresh DNS data.

How often should I flush the DNS cache?

Only when you experience DNS-related issues (e.g., “Server not found” errors, wrong content loading). There’s no need to do it regularly.

Will flushing DNS cache log me out of websites?

No. DNS cache is separate from cookies or sessions. You’ll stay logged in to sites you’ve already authenticated.

Does flushing DNS cache speed up my internet?

It can improve performance if you had a corrupted or slow DNS cache, but it won’t increase your bandwidth or reduce latency in general.

Is there a way to flush DNS cache without Terminal?

No built-in GUI method exists for Catalina. You can use third-party apps, but the Terminal command is the standard, safest method.

What if the command says “Operation not permitted”?

This usually means you didn’t use sudo, or your user doesn’t have admin rights. Ensure you’re logged in as an admin and try again.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →