What DNS cache is and why you might clear it

DNS cache is a temporary storage of web addresses your computer has looked up recently. When you type a website name into your browser, your computer asks a DNS server to translate that name (like example.com) into an IP address. Your system then stores that translation so it doesn't have to ask again the next time you visit. This speeds things up — but sometimes the cached information becomes outdated or incorrect.

You might need to clear DNS cache if a website has moved to a new server and you keep reaching the old one, if you're troubleshooting connection problems, or if you've changed your network settings. Clearing the cache forces your computer to fetch fresh information from DNS servers the next time you visit a site.

Key Takeaways

  • DNS cache stores website address translations on your computer and can become outdated, requiring a manual clear to fix connection issues.
  • Windows users open Command Prompt as administrator and type ipconfig /flushdns to clear the cache in seconds.
  • Mac users open Terminal and type sudo dscacheutil -flushcache, then enter their password when prompted.
  • Linux users typically run sudo systemctl restart systemd-resolved or clear the resolver cache depending on their system configuration.
  • After clearing DNS cache, restart your browser or wait a few moments before revisiting sites to see the changes take effect.

Clearing DNS cache on Windows

On Windows, the fastest way to clear DNS cache is through Command Prompt. Right-click the Start menu and select "Command Prompt (Admin)" or "Windows PowerShell (Admin)". If you see a User Account Control prompt asking for permission, click "Yes".

Type the following command exactly as shown and press Enter:

ipconfig /flushdns

You should see a message saying "Successfully flushed the DNS Resolver Cache". Close Command Prompt and restart your browser. The next time you visit a website, your computer will request fresh DNS information instead of using the old cached version.

If you're using Windows 11 and can't find Command Prompt, search for "cmd" in the taskbar search box, right-click the result, and choose "Run as administrator".

Clearing DNS cache on Mac

On Mac, you'll use Terminal to clear DNS cache. Open Terminal by pressing Command + Space, typing "terminal", and pressing Enter. Alternatively, go to Applications > Utilities > Terminal.

Type this command and press Enter:

sudo dscacheutil -flushcache

Your system will prompt you to enter your Mac password. Type it (the characters won't appear on screen) and press Enter. You won't see a confirmation message, but the cache has been cleared. Close Terminal and restart your browser.

On newer Macs running macOS 10.15 or later, you can also try this alternative command if the first one doesn't work:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Clearing DNS cache on Linux

Linux systems vary in how they handle DNS caching, so the method depends on what your system is running. Most modern Linux distributions use systemd-resolved, which is the default resolver service.

Open a terminal and type:

sudo systemctl restart systemd-resolved

Press Enter and type your password when prompted. This restarts the DNS resolver service, which clears the cache.

If your system uses a different DNS service like dnsmasq or BIND, the commands differ. Check your system documentation or run systemctl status systemd-resolved to see if systemd-resolved is active. If it's not, you may need to clear cache through your specific DNS service's configuration.

Clearing DNS cache in your browser

Your browser also keeps its own separate DNS cache, independent of your operating system's cache. Clearing your browser's cache won't clear your system's DNS cache, but doing both gives you a completely fresh start.

In Chrome or Edge, press Ctrl + Shift + Delete (Windows) or Command + Shift + Delete (Mac) to open the Clear Browsing Data window. Select "All time" from the time range dropdown, check "Cookies and other site data", and click "Clear data". In Firefox, go to Settings > Privacy & Security, scroll to Cookies and Site Data, and click "Clear Data".

After clearing both your system DNS cache and your browser cache, close and reopen your browser before visiting the site you were having trouble with.

When to clear DNS cache and what to expect

Clear your DNS cache when a website you visit regularly has moved or changed servers and you're seeing an old version, when you've recently changed your router or network settings, or when you're troubleshooting why a site won't load. It's also useful after changing your DNS provider — for example, if you switched from your ISP's DNS to a public DNS like Google's 8.8.8.8.

After clearing DNS cache, the next lookup for a website will take slightly longer than usual because your computer has to contact a DNS server instead of using the stored result. This delay is typically less than a second and only happens once per site. After that first lookup, the new information gets cached again for faster future visits.

If clearing DNS cache doesn't fix your problem, the issue may be elsewhere — check that your internet connection is working, restart your router, or verify that the website itself is online by checking a site status service.

Frequently Asked Questions

Will clearing DNS cache delete my passwords or browsing history?

No. DNS cache only stores website address translations, not passwords, history, or personal data. Clearing it is completely safe and won't affect your saved passwords, bookmarks, or any other browser settings.

How often should I clear my DNS cache?

Most people never need to clear DNS cache. You only need to do it when you're troubleshooting a specific problem, like a website not loading after a server change. There's no benefit to clearing it regularly.

What's the difference between clearing DNS cache and clearing browser cache?

DNS cache stores website addresses and their IP numbers. Browser cache stores images, scripts, and other files from websites to load them faster next time. They're separate systems, and clearing one doesn't affect the other.

Why does my website still show the old version after I clear DNS cache?

Your browser cache might still have the old page stored. Clear your browser cache as well, then close and reopen your browser completely. If it still shows the old version, the website's server might not have fully updated yet, or your ISP's DNS servers might not have the new information.

Can I clear DNS cache on my phone?

Most phones don't have a manual DNS cache clearing option. On iPhone, restart your phone or toggle airplane mode on and off. On Android, go to Settings > Apps > Show System Apps, find "DNS Resolver" or your system's DNS service, and tap "Storage" > "Clear Cache". Restarting your phone is usually simpler and achieves the same result.