How to Clear DNS Cache to Fix Website Loading and Connectivity Issues

Share
A computer screen displays a command prompt window with a DNS flush command typed in, illustrating clearing DNS cache on Windows.

If websites are loading slowly, showing outdated content, or failing to load correctly, your DNS cache might be the cause. DNS cache stores recent domain name lookups to speed up browsing, but it can hold outdated or incorrect information that interferes with proper website loading. Clearing the DNS cache removes this stored data, forcing your device to fetch fresh information from DNS servers and often fixing related problems.

What is DNS cache and why clear it?

DNS cache is a temporary record stored by your device or network that maps domain names to IP addresses you’ve visited recently. This cache helps your device connect to websites faster by avoiding repeated lookups. However, if the cached data is outdated, incorrect, or corrupted—for example, if a website has changed its hosting server—your device might try to connect to the wrong address or display old content. Clearing the DNS cache deletes these stored records, so your device requests updated information from DNS servers, which can resolve errors and loading issues.

How do I clear DNS cache on my computer?

Clearing your DNS cache depends on your operating system. Follow these safe steps:

Windows:

  1. Open the Start menu and type "cmd".

Run Command Prompt as an administrator to execute the flush command.

  1. Right-click on "Command Prompt" and select "Run as administrator."
  2. Type the following command and press Enter:
ipconfig /flushdns
Command Prompt
  1. You should see a confirmation message that the DNS Resolver Cache was successfully flushed.

macOS:

  1. Open the Terminal app.
  2. Depending on your macOS version, enter one of these commands and press Enter:

For macOS Catalina and later:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Terminal

For earlier versions, the command may differ; if unsure, use the above as it covers recent versions.

  1. Enter your administrator password when prompted. The command completes silently without confirmation.

Linux: Linux systems vary, but many use systemd-resolved or other DNS services:

For systemd-resolved (common on Ubuntu):

systemd-resolve --flush-caches
Linux shell

Alternatively, restart the DNS service or network manager:

sudo systemctl restart systemd-resolved
Linux shell

If your distribution uses a different DNS caching service, check its documentation. After these steps, your computer’s DNS cache will be cleared.

How to clear DNS cache in your web browser

Web browsers often keep their own DNS cache separate from the operating system. Clearing it can help if a website won’t load correctly even after flushing your system DNS cache.

Google Chrome:

  1. Current versions of Chrome no longer offer a "Clear host cache" option on the net-internals page.
  2. Close and restart Chrome instead, which clears its DNS cache.

Mozilla Firefox:

  1. Enter about:networking#dns in the address bar.
  2. Click "Clear DNS Cache."

Microsoft Edge:

  1. Current versions of Edge no longer offer a "Clear host cache" option on the net-internals page.
  2. Close and restart Edge instead, which clears its DNS cache.

This clears only the browser’s DNS entries. If problems affect all browsers, clearing the system or router DNS cache is also necessary.

When and how to clear DNS cache on your router

Your router can cache DNS information to speed up lookups for all devices on your network. If you’ve cleared DNS caches on your devices but issues persist across multiple devices, the router’s cache might be outdated.

Consider clearing your router’s DNS cache if:

  • Multiple devices on your network experience similar DNS problems.
  • You recently changed DNS settings on the router.

Most routers don’t have a dedicated “clear DNS cache” option. The safest way to clear it is to restart the router:

  1. Unplug the router from power.
  2. Wait 30 seconds to 1 minute.
  3. Plug it back in and wait for it to fully reboot.

This reboot clears the router’s DNS cache and often resolves network-wide DNS issues. Some advanced routers may offer a cache flush option in their settings—check your router’s manual if available. Avoid factory resets or firmware updates just to clear DNS cache, as those have other consequences.

What issues can clearing DNS cache fix?

Clearing DNS cache can resolve several common problems:

  • Websites not loading or timing out despite an active internet connection.
  • Being directed to the wrong website or seeing outdated content after a site’s IP address changed.
  • Frequent "DNS server not responding" or similar errors.
  • Inability to access certain sites while others load fine.
  • Slow website loading caused by repeated DNS lookup failures.

If you notice these issues, clearing your DNS cache is a straightforward first step before more advanced troubleshooting.

What to expect after clearing DNS cache and precautions

After clearing your DNS cache, your device will fetch fresh DNS information when you visit websites. The first visit after clearing might load slightly slower because the system needs to look up addresses again.

Clearing DNS cache is safe and won’t cause data loss. Keep in mind:

  • You may temporarily lose the speed benefit for frequently visited sites until the cache rebuilds.
  • Clearing the cache won’t fix problems caused by misconfigured DNS settings; it only removes stored records.
  • You might need to clear caches on multiple devices or your router if problems continue.

If issues persist after clearing DNS caches everywhere, the cause may lie with your internet connection, DNS provider, or the websites themselves rather than local caching.

Conclusion

Start by clearing the DNS cache on your device when websites load slowly or incorrectly. If that doesn’t fully fix the problem, clear the DNS cache in your browser and restart your router to refresh the network-wide cache. These steps often resolve common DNS-related issues safely and effectively. If problems continue, additional network troubleshooting may be necessary.

Frequently Asked Questions

How often should I clear my DNS cache?

You only need to clear your DNS cache when you encounter problems like slow or incorrect website loading. Regularly clearing it isn’t necessary and can slow down browsing temporarily as the cache rebuilds.

Will clearing DNS cache affect my internet speed?

Right after clearing the DNS cache, visiting websites may be a bit slower since your device has to look up addresses again. After that, your browsing speed returns to normal as the cache fills with fresh data.

Can clearing DNS cache fix all internet connection problems?

No. Clearing DNS cache helps only with issues related to translating domain names to IP addresses. If your problem is with your internet service, network hardware, or the website itself, clearing the DNS cache won’t solve it.