User Agents

Web browsers and everyday web tech, explained

Clear DNS Cache on Windows Mac Chrome Firefox Safari

· 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 removes stored website addresses your device has recently accessed, which can resolve issues like slow browsing, incorrect page loading, or inability to reach updated sites. When you visit a website, your system saves its DNS (Domain Name System) information to load it faster next time. However, if the site’s address changes or your cache becomes outdated or corrupted, it can cause errors. Flushing the DNS cache forces your device to fetch fresh DNS records, helping restore proper connectivity. This guide covers how to clear the DNS cache on Windows, macOS, Chrome, Firefox, and Safari.

What You'll Need

  • Administrator or user access to your operating system
  • Command Prompt (Windows) or Terminal (macOS) access
  • Internet browser with administrative privileges if needed
  • Stable internet connection (to verify results after clearing)

Step-by-Step

  1. Clear DNS Cache on Windows
    • Press Windows + R, type cmd, then press Ctrl + Shift + Enter to open Command Prompt as administrator.
    • When prompted by User Account Control, click Yes.
    • Type ipconfig /flushdns and press Enter.
    • You should see the message: "Successfully flushed the DNS Resolver Cache."
    • Close the window and restart your browser to test.
  2. Clear DNS Cache on macOS
    • Open Applications > Utilities > Terminal.
    • Enter the correct command based on your macOS version:
      • macOS Ventura, Monterey, Big Sur (10.15+): sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
      • macOS Catalina to High Sierra (10.14–10.13): sudo killall -HUP mDNSResponder
      • macOS Sierra and earlier (10.12 and below): sudo killall -HUP mDNSResponder
    • Press Enter, then type your administrator password when prompted (no visual feedback as you type).
    • Press Enter again. No confirmation message appears, but the cache is cleared.
    • Close Terminal and restart your browser.
  3. Clear DNS Cache in Google Chrome
    • Open Chrome and go to chrome://net-internals/#dns in the address bar.
    • Press Enter. This opens Chrome’s internal network tools.
    • Click the Clear host cache button under the DNS tab.
    • No visible confirmation appears, but the cache is immediately cleared.
    • Optionally, go to chrome://net-internals/#sockets and click Close idle sockets for a more complete refresh.
  4. Clear DNS Cache in Mozilla Firefox
    • Open Firefox and type about:config in the address bar.
    • Click Accept the Risk and Continue if prompted.
    • In the search bar, type network.dnsCacheExpiration.
    • Double-click the preference and set its value to 0, then press Enter.
    • Immediately change it back to 60 (default in seconds) to re-enable caching.
    • Alternatively, restart Firefox—this automatically clears the internal DNS cache.
  5. Clear DNS Cache in Safari
    • Open Safari and go to Safari > Preferences > Advanced.
    • Check the box: Show Develop menu in menu bar.
    • From the menu bar, click Develop > Empty Caches.
    • Alternatively, press Option + Command + E.
    • Note: This clears all caches (including DNS, images, scripts), not just DNS.

Common Mistakes

  • Forgetting to run Command Prompt or Terminal as administrator—this causes permission errors.
  • Using outdated commands for macOS versions (e.g., using dscacheutil on older systems where it’s not needed).
  • Not restarting the browser after clearing cache, leading to persistent issues.
  • Typing incorrect commands (e.g., ipconfig /releasedns), which do not exist.
  • Assuming a visible confirmation always appears—some systems (like macOS) give no feedback.

Tips

  • Clear DNS cache after changing network settings, switching DNS providers, or troubleshooting website access.
  • Combine DNS clearing with flushing the browser cache for better results.
  • Use ipconfig /displaydns on Windows to view current cached entries before flushing.
  • On macOS, you can verify the cache was cleared by checking for new DNS queries in Console logs.
  • Regularly clearing DNS is not necessary—only do it when troubleshooting connectivity issues.

Troubleshooting

  • Command not recognized (Windows): Ensure you’re using Command Prompt, not PowerShell or Windows Terminal in non-CMD mode. Type cmd to launch it correctly.
  • Permission denied (macOS): Always use sudo and enter your admin password. Ensure your user account has admin rights.
  • No effect after clearing: The issue may not be DNS-related. Try restarting your router or checking your internet connection.
  • Chrome internal page not loading: Ensure you type chrome://net-internals/#dns exactly—no spaces or missing colons.
  • Safari Develop menu missing: Confirm you’ve enabled it in Preferences > Advanced. If still missing, reset Safari settings via Safari > Clear History and Website Data.
  • Website still not loading: The problem could be server-side. Test on another device or network to isolate the cause.

Frequently Asked Questions

Does clearing DNS cache delete passwords or history?

No. DNS cache only stores website address mappings. It does not affect saved passwords, browsing history, or cookies.

How often should I clear DNS cache?

Only when troubleshooting. Regular clearing isn’t needed and may slightly slow initial page loads.

Can I clear DNS cache without admin rights?

On Windows and macOS, administrator privileges are required for system-level DNS flushing. Browser-level clearing may not need admin access.

Does Chrome’s DNS cache differ from the system’s?

Yes. Chrome maintains its own DNS cache separate from the OS. Clear both for full effect.

Why does Safari clear all caches instead of just DNS?

Safari does not offer a separate DNS-only option. Emptying caches clears DNS along with other stored data.

Will clearing DNS cache improve internet speed?

Temporarily, for specific sites with outdated DNS. It won’t boost overall bandwidth or connection speed.