Clear DNS Cache on Windows & macOS (Step-by-Step 2025)

Clear DNS Cache to resolve websites loading with old IP addresses, intermittent name-resolution errors, or strange redirects after DNS changes. Flushing the local resolver cache forces your device to fetch fresh DNS records from the configured DNS servers, which often fixes sluggish lookups and “site not found” issues with zero risk to your files.

What Is DNS Cache & Why Clear It?

The DNS (Domain Name System) cache is a local database of recent hostname → IP address lookups. Caching avoids repeated queries and speeds up browsing, but stale or corrupted entries can cause wrong addresses to be used. Clearing the cache removes outdated records so the resolver fetches up-to-date results from your DNS provider.

  • Pages don’t load or load the wrong site
  • Domain moved to a new host but shows the old server
  • DNS settings changed (nameservers, A/AAAA/CNAME), but your device still sees old data
  • Suspicious redirects or security concerns after cleanup/malware removal
Clear DNS Cache on Windows and macOS

Clear DNS Cache on Windows

These steps work on Windows 10 and Windows 11. If you’re on a managed PC and the flush fails, try running the command prompt as Administrator.

  1. Press Windows + R, type cmd, press Enter.
  2. Run the flush command:
ipconfig /flushdns

You should see: “Successfully flushed the DNS Resolver Cache.”

Optional Windows checks

  • View current entries: ipconfig /displaydns
  • Renew IP (if you changed networks): ipconfig /release then ipconfig /renew
  • Reset the Winsock catalog (fixes deeper socket issues): netsh winsock reset (reboot required)

Clear DNS Cache on macOS

Use Terminal to Clear DNS Cache on modern macOS versions. Commands require your admin password and don’t produce on-screen success messages.

  1. Open Terminal (Applications → Utilities or Spotlight).
  2. Run the universal flush for recent macOS releases:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Version notes

  • Monterey, Ventura, Sonoma: Use the command above.
  • Sierra → Big Sur: sudo killall -HUP mDNSResponder typically suffices.

Tip: If you just changed Wi-Fi networks or VPNs, toggle Wi-Fi off/on after the flush to ensure clean resolver behavior.

When Should You Clear DNS Cache?

  • Immediately after switching to Google (8.8.8.8) or Cloudflare (1.1.1.1)
  • After updating DNS records or migrating hosting
  • When a site resolves to the wrong IP or shows old content
  • Following adware/malware cleanup to remove suspicious records

Troubleshooting After You Clear DNS Cache

  • Check name resolution: On Windows: nslookup example.com. On macOS: dig example.com or nslookup. Verify the returned IP is the expected one.
  • Restart browser: Browsers maintain their own caches. Close all windows or use a private window for a clean test.
  • DHCP or VPN issues: If results still look stale, disconnect/reconnect VPN, or renew your IP lease.
  • Hosts file overrides: A custom entry in the local hosts file can override DNS. Remove any stray mappings if present.

Improve Performance After Flush

Flushing stale entries is a great first step. For consistently faster lookups, use a reliable resolver and keep your stack tidy:

  • Google DNS: 8.8.8.8 and 8.8.4.4
  • Cloudflare DNS: 1.1.1.1 (and 1.0.0.1)
  • Clear browser DNS/host cache when debugging persistent issues
  • Avoid chaining multiple VPNs that may add latency to DNS queries

FAQ

Do I need admin rights? Windows flush usually works in a standard CMD, but some environments require “Run as administrator.” On macOS, sudo prompts for your password.

Will I lose saved passwords or files? No. You only remove temporary name-resolution records, not browser data or documents.

How often should I Clear DNS Cache? Only when needed—after DNS changes, host migrations, or suspicious redirects. Routine daily flushing isn’t necessary.

Final Thoughts

Use these platform-specific commands to Clear DNS Cache safely and force fresh lookups from your configured DNS servers. If issues persist after flushing, verify the authoritative DNS records themselves are correct and fully propagated, then test from a different network to rule out upstream caching or filtering.