User Agents

Web browsers and everyday web tech, explained

How to Reset DNS Cache on Any Device

· 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

Resetting the DNS cache clears stored domain name records from your device, which can resolve issues like websites failing to load, showing outdated content, or redirecting incorrectly. When you visit a website, your system saves its IP address in a temporary cache to speed up future visits. However, if the website’s IP changes or the cache becomes corrupted, your device might use outdated information. Flushing the DNS cache forces your system to look up fresh IP addresses, restoring proper access. This process is safe, quick, and doesn’t affect your personal files or settings. It's especially useful after network changes, website migrations, or when troubleshooting connectivity problems.

What You'll Need

  • Administrative or sudo access to your device
  • Command-line or terminal access (for most operating systems)
  • Internet connection (to verify results after reset)

Step-by-Step

  1. Windows: Use Command Prompt as Administrator
    Press Windows + S, type "cmd", right-click on Command Prompt, and select "Run as administrator". Type ipconfig /flushdns and press Enter. You should see a confirmation message: "Successfully flushed the DNS Resolver Cache."
  2. macOS: Use Terminal
    Open Terminal (found in Applications > Utilities). For macOS 12 (Monterey) and later, enter sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. For older versions, use sudo killall -HUP mDNSResponder. Enter your admin password when prompted. No confirmation appears, but the cache is cleared.
  3. Linux (Ubuntu/Debian-based): Restart DNS Service
    Most Linux distributions use systemd-resolved. Open Terminal and run sudo systemd-resolve --flush-caches. To verify, use sudo systemd-resolve --statistics and check "Current Cache Size"—it should be 0. If your system uses dnsmasq, restart it with sudo systemctl restart dnsmasq.
  4. ChromeOS: Access Diagnostics Tool
    Click the clock in the bottom-right, select your profile, then click the gear icon to open Settings. Go to Advanced > Network > Network details. This opens a diagnostic window where you can view network info. While ChromeOS doesn’t allow direct DNS cache flushing, restarting the device clears the cache automatically. Alternatively, disable and re-enable Wi-Fi or use a different network to force refresh.
  5. Android: No Direct Method, But Workarounds Exist
    Android doesn’t provide a user-accessible DNS cache flush. Restart your device to clear temporary network data. For rooted devices, use a terminal app and run ndc resolver flushdefaultif (requires root). You can also change DNS settings temporarily—go to Wi-Fi settings, modify your network, and set a private DNS like dns.google—then switch back.
  6. iOS: Restart or Toggle Airplane Mode
    iOS doesn’t allow direct cache clearing via settings. Restart your iPhone or iPad completely. Alternatively, enable Airplane Mode for 10 seconds, then disable it. This forces the device to re-establish network connections and fetch new DNS records.
  7. Verify the Reset
    After flushing, test by visiting a site that was problematic. Use nslookup example.com (Windows) or dig example.com (macOS/Linux) to check if the IP has updated. Compare results with a known good device or online DNS lookup tool.

Common Mistakes

  • Running commands without administrative privileges, causing permission errors.
  • Using outdated commands, such as killall -HUP mDNSResponder without dscacheutil on newer macOS versions.
  • Expecting immediate website changes—DNS propagation can take minutes to hours globally.
  • Confusing DNS cache with browser cache; they are separate and require different clearing methods.
  • Forgetting to reconnect to Wi-Fi after toggling Airplane Mode on mobile devices.

Tips

  • Always restart your router if multiple devices have DNS issues—this resets the network-wide DNS cache.
  • Use public DNS servers like Google (8.8.8.8) or Cloudflare (1.1.1.1) for faster, more reliable lookups.
  • On Linux, check which DNS service you’re using with resolvectl status before running flush commands.
  • Combine DNS flush with clearing browser cache for best results when troubleshooting website issues.
  • On macOS, if commands fail, try rebooting—some network services reset more reliably on startup.

Troubleshooting

If the DNS cache reset doesn’t work, first verify you used the correct command for your OS version. On Windows, if ipconfig /flushdns fails, ensure you ran Command Prompt as administrator. On macOS, if no response appears, the command likely succeeded—macOS doesn’t always provide feedback. For Linux, if systemd-resolve is not found, your distribution may use a different resolver—check documentation for your specific version. If websites still don’t load, the issue may not be DNS-related. Test by accessing the site via IP address (if known) or using a mobile data connection. If the site loads on other networks, the problem may be with your ISP’s DNS. Try switching to a public DNS server. Persistent issues could indicate firewall rules, malware, or incorrect network settings—review IP configuration and security software.

Frequently Asked Questions

How often should I reset my DNS cache?

Only when you encounter website access issues, after network changes, or if sites load incorrectly. Routine flushing isn’t necessary.

Does resetting DNS cache improve internet speed?

Not directly, but it can fix slow loading caused by incorrect or outdated DNS records, restoring normal speed.

Is it safe to flush DNS cache?

Yes. It only clears temporary network data and forces fresh lookups. It doesn’t harm your system or delete personal files.

Why doesn’t my Mac show a confirmation after flushing DNS?

macOS typically provides no visual confirmation. If no error appears, the command succeeded. You can test by visiting a site that had issues.

Can I reset DNS cache on a router?

Yes. Restarting your router clears its DNS cache. Some advanced routers also let you manually flush or change DNS settings via their admin interface.

Does flushing DNS affect all websites?

It clears all stored DNS entries, so every site you visit afterward will require a fresh lookup, but only until they’re cached again.