User Agents

Web browsers and everyday web tech, explained

How to Clear DNS Cache on Windows, Mac, and Browsers

· 5 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 your DNS cache removes outdated or incorrect website address records stored by your operating system or browser, helping resolve issues like websites not loading, showing old content, or failing to connect even when online. This process forces your system or browser to fetch fresh DNS records, which can fix errors after changing networks, switching DNS providers, or when a site updates its server location. It's a standard troubleshooting step for connectivity and display problems.

What You'll Need

  • Administrative access on Windows or Mac (required for system-level DNS flush)
  • Terminal (Mac) or Command Prompt/PowerShell (Windows)
  • Browser access (Chrome, Firefox, Safari, or Edge)
  • Stable internet connection (to verify changes after clearing)

Step-by-Step

  1. Close all browser windows before starting to ensure no cached data is in active use. This avoids conflicts when clearing browser-specific DNS.
  2. On Windows: Open Command Prompt as Administrator. Press Windows + S, type "cmd", right-click "Command Prompt", and select "Run as administrator". Confirm UAC prompt if shown.
  3. Flush DNS on Windows. In the Command Prompt window, type ipconfig /flushdns and press Enter. You should see a confirmation message: "Successfully flushed the DNS Resolver Cache."
  4. On Mac: Open Terminal. Use Spotlight (Cmd+Space) to search for "Terminal" and open it. No admin password is needed for the DNS flush command.
  5. Flush DNS on Mac. Enter the command sudo dscacheutil -flushcache and press Enter. You may need to enter your admin password. Then, also run sudo killall -HUP mDNSResponder to ensure full cache clearance on newer macOS versions.
  6. Clear DNS in Google Chrome. Open Chrome and type chrome://net-internals/#dns in the address bar. Click the "Clear host cache" button. This removes Chrome’s internal DNS storage.
  7. Clear DNS in Mozilla Firefox. Type about:networking#dns in the address bar. Click the "Clear DNS Cache" button. Note: This option is only available in Firefox 117 and later.
  8. Clear DNS in Safari. Safari uses the system DNS cache on macOS. After flushing the system cache (Step 5), Safari will automatically use updated records. No separate browser-level action is needed.
  9. Clear DNS in Microsoft Edge. Enter edge://net-internals/#dns in the address bar and click "Clear host cache". Edge shares Chrome’s DNS cache mechanism, so this works identically to Chrome.
  10. Restart your browser after clearing DNS. Reopen it and navigate to a site that previously had issues to verify the fix.
  11. Test connectivity. Visit a few websites, especially ones you were having trouble with, to confirm they load correctly. If not, proceed to troubleshooting.

Common Mistakes

  • Running the flush command without administrator privileges on Windows, which results in "Access is denied" errors.
  • Using outdated macOS commands—older guides suggest lookupd -flushcache, which no longer works on modern macOS versions.
  • Forgetting to clear both system and browser DNS caches. Some issues persist if only one is cleared.
  • Typing browser DNS URLs incorrectly—missing slashes or using "http://" instead of direct entry into the address bar.
  • Assuming the flush worked immediately—some routers or ISPs may still serve cached DNS, delaying resolution.

Tips

  • Clear DNS after switching networks (e.g., from home to public Wi-Fi) to avoid connection delays.
  • Use ipconfig /displaydns on Windows to view cached entries before flushing—helps confirm what’s being removed.
  • On Mac, run both dscacheutil and killall commands to cover all DNS services, especially on macOS 10.15 and later.
  • Consider restarting your router if DNS issues persist system-wide—routers also cache DNS and may need a reset.
  • Use a public DNS (like Google DNS or Cloudflare) if frequent DNS problems occur, as they often update faster than ISP defaults.

Troubleshooting

If the DNS flush doesn’t resolve the issue, first verify you ran commands with proper permissions. On Windows, ensure Command Prompt was run as administrator. On Mac, confirm you entered your password correctly when using sudo. If the browser DNS clear fails, check that you’re using the correct internal URL—some versions may require exact spelling.

If sites still don’t load, the problem may not be local DNS. Try accessing the site from another device on the same network. If it fails there too, the issue may be with your router, ISP, or the website itself. Restart your router and wait a few minutes before testing again.

If only one browser has issues, clear its entire cache and cookies—not just DNS. Corrupted site data can mimic DNS problems. For persistent issues, reset browser settings to default, but back up bookmarks first.

Use nslookup example.com (Windows/Mac) to check if DNS is resolving correctly. Replace "example.com" with the problematic site. If it returns an incorrect or no IP, your DNS provider may be the issue. Switching to 8.8.8.8 (Google DNS) can help test this.

Frequently Asked Questions

How often should I clear DNS cache?

Only when troubleshooting connectivity or after network changes. Routine clearing isn’t necessary and may slow browsing temporarily.

Does clearing DNS cache improve speed?

Not directly. It may speed up access to recently moved sites by preventing failed lookups, but normal browsing speed depends more on connection and server response.

Is it safe to clear DNS cache?

Yes. It only removes temporary address records. No personal data or settings are affected.

Why do I need to clear both system and browser DNS?

Because both store DNS records independently. One may have correct data while the other has outdated entries causing errors.

Does clearing DNS log me out of websites?

No. DNS cache is separate from cookies and login sessions. You won’t be logged out unless you clear browser data manually.

Can I clear DNS on mobile devices?

Yes, but methods differ. On iOS, restarting the device clears DNS. On Android, go to Wi-Fi settings, forget the network, and reconnect, or use DNS-flushing apps.