Skip to content
✨ Limited offer: 50% OFF your first month
Knowledgebase

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

Akash Yadav 6 min read
How to Clear DNS Cache on Windows, Mac, Linux, and Browsers

Have you ever visited a website, knowing it was up and running, and still gotten an error? Sometimes it’s not the website that’s the issue. It’s the old data saved on your computer. The stored data is called the DNS cache.

The great news is that you can fix it in a minute. In this guide, you’ll learn how to flush DNS you need as a Windows user, as well as Mac, Linux and your browser. We will also go over a step-by-step process for Chrome clear DNS.

What Is a DNS Cache?

DNS is short for Domain Name System. It’s the phonebook of the internet. When you type a website name like example.com, your computer needs to know the website’s IP address, which is a number that tells it where the site lives. DNS looks that number up for you .

It would be slow to look up that number each time. So your computer and browser store it for later. This saved list is called the DNS cache. When you next visit the same site, your device will use the saved address and the page will load faster.

Also Read: How to Fix HTTP 401 Unauthorized Error: 5 Proven Methods

Why Should You Flush DNS?

Caching is good but cached data may be wrong. Why you might want to flush your DNS:

  • The data is old. When a website moves to a new server, its IP address changes. It can take up to 48 hours for this change to reach all servers around the world. Your computer may still use the old address, so the site will not open or will show the old version.
  • The data is broken. A bad entry in the cache can cause “page not found” or “server not found” errors, even when the website works for everyone else.
  • Your safety is at risk. Hackers can use tricks like DNS spoofing to put fake entries into your cache. This can send you from a real website, like your bank, to a fake one that steals your information. Clearing the cache removes these bad entries.
  • You want to fix network problems. Flushing the cache is a quick and safe first step when your internet is acting strange.

The DNS cache can be flushed safely. It doesn’t clear your browsing history, passwords, or files. It doesn’t change your IP address either. The only small effect is that your next visit to a website might be a little slower , as your computer has to look up the address again .

How to Flush DNS on Windows

The method is almost the same on Windows 11, 10, 8, and 7. Follow these steps to flush DNS Windows computers use:

  1. Click the Start menu and type cmd.
  2. Right-click Command Prompt and choose Run as administrator.
  3. If a permission box appears, click Yes.
  4. Type this command and press Enter:

ipconfig /flushdns

  1. You will see a message that says “Successfully flushed the DNS Resolver Cache.”

That’s it. Your Windows DNS cache is now clear.

Also Read: How to Resolve the YouTube “Something Went Wrong” Error on Any Device

How to Clear DNS Cache on Mac

On a Mac, you use an app called Terminal. Open it from Applications > Utilities > Terminal, or press Command + Space and type “Terminal.”

The command depends on your macOS version. Click the Apple icon and choose About This Mac to check yours.

macOS VersionCommand
macOS 10.10 to latest (Yosemite and newer)sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
macOS 10.7 to 10.9 (Lion to Mavericks)sudo killall -HUP mDNSResponder
macOS 10.6 (Snow Leopard)sudo dscacheutil -flushcache
macOS 10.5 (Leopard)sudo lookupd -flushcache

After you press Enter, type your Mac password when asked. You will not see the letters as you type, which is normal. Mac usually shows no success message. If no error appears, the cache is cleared.

How to Clear DNS Cache on Linux

Open the Terminal by pressing Ctrl + Alt + T. Then use the command that fits your system.

For Ubuntu and most modern Linux systems:

sudo systemd-resolve –flush-caches

For systems that use nscd:

sudo /etc/init.d/nscd restart

For systems that use dnsmasq:

sudo /etc/init.d/dnsmasq restart

If one command gives an error, simply try the next one. A wrong command will not harm your computer.

How to Clear DNS Cache in Chrome

Your operating system is not the only place where DNS data is saved. Google Chrome also keeps its own copy. So even after you flush the system cache, you may need to clear DNS cache Chrome keeps for itself.

Here is how to do chrome flush DNS cache in a few quick steps:

  1. Open Google Chrome.
  2. In the address bar, type this and press Enter:

chrome://net-internals/#dns

  1. Click the Clear host cache button.

That is all you need to clear Chrome DNS cache. This is the easiest way to delete DNS cache Chrome has stored, and it works the same way if you want to chrome clear DNS data again later.

For best results, flush DNS Windows or Mac first, and then clear DNS cache Chrome uses. Doing both makes sure old data is gone from every place.

Also Read: How to Fix ERR_SSL_PROTOCOL_ERROR in Chrome & Other Browsers (Full Guide)

Clear DNS Cache in Other Browsers

Microsoft Edge is built on the same engine as Chrome, so the steps are almost the same. Type edge://net-internals/#dns in the address bar and click Clear host cache.

Mozilla Firefox keeps DNS data only in memory, so it is lost when you close the browser. To clear it without closing, type about:networking#dns in the address bar and click Clear DNS Cache.

Safari uses the Mac system cache. When you clear the DNS cache on your Mac, Safari is cleared too.

Restart Your Router Too

Your router also saves DNS data. If many devices cannot open the same website, restart the router. Unplug it, wait about 30 to 60 seconds, plug it back in, and wait for it to start fully.

What About Phones?

Phones do not have a simple command for this. Turn on Airplane Mode for about 30 seconds and turn it off, or restart the phone. Both usually clear the DNS cache.

When Should You Flush DNS?

You do not need to do this every day. Do it when:

  • A website will not open, but it works on other devices.
  • You see an old version of a website that has just been updated or moved.
  • You see strange redirects or a fake-looking page.
  • You are fixing general internet problems.

What If the Problem Is Still There?

If a site still does not open after you flush DNS, try these:

  • Clear your browser cookies and site data.
  • Open the site in a different browser or on another device.
  • Turn off your VPN or firewall for a moment.
  • Check if the website is down for everyone.
  • Contact your internet provider.

Final Thoughts

Learning how to flush your DNS is a small trick that can save you a lot of time. Whether you need to flush DNS Windows, clear cache on Mac or Linux or clear Chrome DNS cache, steps are short and safe. Get in the habit of clearing your system cache and your browser cache when a website is behaving strangely. You will solve most connection problems quickly.

Ask AI about this article

Get a quick summary or ask follow-up questions.

Share this article WhatsApp LinkedIn X Facebook
Written by

Akash Yadav

Part of the Shree Digital Tech team, helping businesses in the USA, UK, Canada, Australia, Europe and India grow with SEO, paid media, content and websites.

Keep Reading

Related Articles

View all articles