User Agents

Web browsers and everyday web tech, explained

How to Clear DNS Cache on a Mac OS X Computer

· 4 min read · Cookies and Cache

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Clearing the DNS cache on a Mac OS X computer forces it to discard stored domain name resolution records and fetch fresh ones from your DNS server. This is useful when websites load with errors, show outdated content, or after you change your DNS settings or website hosting. You don't need special tools—just the built-in Terminal app and one command. The exact command varies slightly depending on your macOS version, so check which one you have first.

What You'll Need

  • Administrator (admin) account access on the Mac—you'll need to enter your password.
  • Terminal app (found in /Applications/Utilities/).
  • Your macOS version (Apple menu About This Mac).

Step-by-Step

  1. Check your macOS version. Click the Apple logo in the top-left corner, select "About This Mac," and note the version number (e.g., macOS Sonoma 14.5, Ventura 13.6, Monterey 12.7, Big Sur 11.7, Catalina 10.15, Mojave 10.14, High Sierra 10.13, Sierra 10.12, or El Capitan 10.11).
  2. Open Terminal. Go to Applications > Utilities > Terminal, or press Cmd+Space and type "Terminal" to open it via Spotlight.
  3. Run the correct flush command for your macOS version.
    • macOS Ventura (13) and later: Type sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder and press Enter.
    • macOS Monterey (12) and Big Sur (11): Same as above: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder.
    • macOS Catalina (10.15) and Mojave (10.14): Use sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder (same command).
    • macOS High Sierra (10.13) and Sierra (10.12): Use sudo killall -HUP mDNSResponder (no dscacheutil needed).
    • OS X El Capitan (10.11): Use sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder.
  4. Enter your admin password. When prompted, type your Mac's login password. You won't see characters as you type—that's normal. Press Enter.
  5. Wait for the command to complete. It usually finishes in a second or two. If you see no error message, the cache was flushed successfully.
  6. Verify (optional). To confirm the cache is empty, type sudo dscacheutil -cachedump -entries Host and press Enter. If it returns nothing or shows no host entries, the cache is clear.

Common Mistakes

  • Using the wrong command for your macOS version. Older commands like lookupd -flushcache (for OS X 10.4) or dscacheutil -flushcache alone (for 10.10 and earlier) won't work on newer systems. Always match the command to your version.
  • Forgetting the sudo prefix. Without it, you'll get a "permission denied" error. Always start with sudo.
  • Typing the password incorrectly. Since it's invisible, a typo will cause "Sorry, try again." Be careful and re-type if needed.
  • Not closing and reopening the Terminal. Some users expect the command to automatically close Terminal; it doesn't. You can close it manually after the command runs.

Tips

  • Copy-paste the command to avoid typos. In Terminal, you can right-click and paste, or press Cmd+V.
  • Run the command as a single line with the semicolon between the two parts. If you run them separately, the first part (dscacheutil) will work, but the second (killall) might not flush the mDNSResponder cache.
  • Restart your browser after flushing to ensure it picks up the new DNS info. Some browsers cache DNS themselves.
  • If you're using a VPN or proxy, you may need to disconnect and reconnect after flushing, as those services can have their own DNS caches.

Troubleshooting

Command not found: If you see "command not found," you likely mistyped the command or are using an unsupported macOS version. Double-check the spelling and your macOS version.

Permission denied: This means you didn't use sudo or you're not an admin user. Log in with an admin account or ask the admin to run the command.

Password not accepted: Ensure you're typing the correct admin password. If you've forgotten it, you'll need to reset it via Apple ID or recovery mode.

Still seeing old DNS after flushing: The DNS cache might be held by your router or your ISP. Try restarting your router or changing your DNS server to a public one like Google DNS (8.8.8.8) or Cloudflare (1.1.1.1) temporarily to test.

Terminal freezes: This is rare. Press Ctrl+C to cancel the command and try again. If it persists, restart your Mac and retry.

Frequently Asked Questions

Will clearing DNS cache speed up my internet?

It can, if your current cache has stale or corrupted entries. Otherwise, the effect is minimal. It's primarily a troubleshooting step, not a performance booster.

How often should I clear the DNS cache?

Only when you experience DNS-related issues, like websites not loading or showing old content. There's no need to do it regularly.

Is it safe to run these commands?

Yes. They simply restart the DNS resolver process and clear temporary cache files. They won't delete any personal data or settings.

Do I need to restart my Mac after flushing?

No, a restart is not required. The cache is cleared immediately. However, restarting your browser can help ensure it uses the new DNS info.

What if I have an older Mac with OS X 10.10 Yosemite or earlier?

Use sudo dscacheutil -flushcache for Yosemite and earlier. For OS X 10.4 or earlier, use lookupd -flushcache. But these are very old systems and may not be supported anymore.

Why doesn't the command show any output?

That's normal. The command is silent when successful. If there's an error, you'll see a message. No news is good news.