Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Clear Your DNS Cache (Mac, Windows, Chrome)

It’s a frustrating moment for any website owner. You’ve just moved your site or made a big change, but you’re still seeing the old version or, worse, an error message.

We get questions about this issue all the time here at WPBeginner, and the fix is surprisingly simple. Your computer is likely holding onto old directions in its DNS cache and just needs a quick refresh.

In this guide, we will show you exactly how to clear your DNS cache on Windows, Mac, and in the Chrome browser. These simple steps will help you get back to browsing the correct version of your site in minutes.

Easily clear DNS cache in macOS, Windows, and Chrome

Here is a quick overview of what we will cover in this guide:

  1. What Is a DNS Cache?
  2. How to Clear the DNS Cache in Windows
  3. How to Clear the DNS Cache on macOS
  4. How to Clear the DNS Cache in Chrome
  5. How to Check for DNS Updates
  6. What's the Difference Between the DNS Cache and Browser Cache?
  7. Frequently Asked Questions About DNS Cache
  8. Additional Resources on Caches in WordPress

What Is a DNS Cache?

A DNS cache is like an address book saved on your computer. It contains the DNS (Domain Name Server) information of each website you visit.

DNS is a technology that tells your computer the IP address associated with a domain name. To learn more, see our guide on how domain names work.

Saving the DNS information in a local DNS cache helps your browser quickly find a website.

Once you enter a website address in your browser, it will look for DNS information in the local cache first. If it finds the directions, then it uses the DNS cache to visit the website.

On the other hand, if the information is not in the local DNS cache, then the browser will get it from other DNS servers across the internet.

This ensures that every time you visit any website, your browser takes the shortest route to get the DNS information it needs to locate the website on the internet.

An infographic describing how domain names work

However, this may sometimes cause trouble.

For example, when you are moving a WordPress site to a new domain name or moving WordPress to a new host, the DNS information may not get updated quickly on your computer, and you might end up visiting the old website or seeing a not found error.

It will eventually get updated, but why wait when you can clear the DNS cache right away?

Let’s take a look at how to clear the DNS cache across various platforms.

How to Clear the DNS Cache in Windows

Here’s how to clear the DNS cache on a Windows computer.

First, click the ‘Start’ button or the search icon in your taskbar and type ‘Command Prompt’. When it appears in the search results, click to open it.

Opening command prompt in Windows

This will launch a command prompt window. Inside it, you need to enter the following text:

ipconfig /flushdns
Clearing DNS cache in Windows

Simply press the ‘Enter’ key to execute the command, and Windows will flush the DNS cache.

That’s all. You can now resume visiting your website to fetch the updated DNS information.

How to Clear the DNS Cache on macOS

If you are on a Mac computer, then you can follow the steps below to clear your DNS cache.

First, you need to launch the Terminal app. You can find it in the Launchpad under the ‘Other’ folder. You can also launch it by opening Finder and going to the Applications » Utilities folder.

Open Terminal in Applications » Utilities

This will launch the terminal window, where you need to enter the following command:

sudo killall -HUP mDNSResponder

This command safely resets your Mac’s DNS service, which is what tells it to forget the old, cached DNS information.

Clearing DNS cache using terminal on macOS

You will be asked to enter your macOS account password. It is the same password you use to log in to your computer.

After that, your computer will flush the DNS cache. You can now visit the website to get the latest DNS information.

How to Clear the DNS Cache in Chrome

Google Chrome also keeps a DNS cache of its own, and it is separate from the DNS cache stored by your operating system.

If you use Google Chrome as your main browser, then you will need to clear Chrome’s DNS cache as well.

First, you need to enter the following address in your browser’s address bar and press the ‘Enter’ key on your keyboard:

chrome://net-internals/#dns
Clearing the Chrome DNS Cache

This will open a special settings page in Chrome for managing its internal network features.

From here, you need to click on the ‘Clear host cache’ button, and Chrome will clear its DNS cache.

Pro Tip: Many other browsers based on Chromium, like Microsoft Edge, Brave, and Vivaldi, use a very similar process. You can often simply replace “chrome://” with “edge://” or “brave://” to access the same settings page and clear the host cache.

How to Check for DNS Updates

When you are moving your WordPress website to a host or transferring your domain registration to a new domain registrar, you will have to change your DNS settings and point them to the new location.

Once you apply these changes to your domain settings, it will take a while for those changes to propagate across the internet. This could take anywhere between a few hours to a couple of days.

This process is called DNS propagation, and unfortunately, there is no way to speed it up across the entire internet. Clearing your local DNS cache simply ensures that your computer fetches the new information as soon as it’s available from your internet service provider.

During this time, your domain will sometimes point to the old location, and sometimes it will point to the new location. This depends on your geographic location and which DNS servers your browser asks for directions.

You can check how these DNS changes are propagated around the world using online tools like DNS Checker.

Simply enter your domain name, and it will fetch DNS from different geographic locations spread around the world.

Check for DNS updates

If all locations indicate the same IP address with a green checkmark, then this means the DNS changes you made are now updated all over the internet.

What’s the Difference Between the DNS Cache and Browser Cache?

Now, keep in mind that the DNS cache is different from the browser cache.

Your browser saves a lot of website data in a temporary cache to quickly load pages on repeat visits. This contains the actual contents of the websites you visit, while the DNS cache contains the IP addresses where they are located.

If you are having trouble viewing a page that you updated but can’t see your changes, then you will want to clear the browser cache.

We have a step-by-step guide on how to clear the browser cache on all major browsers.

Frequently Asked Questions About DNS Cache

We’ve answered some of the most common questions our readers ask about the DNS cache below. This should help clear up any lingering confusion you might have.

1. What is a DNS cache and why is it important?

A DNS cache is a temporary database on your computer that stores the IP addresses of websites you’ve recently visited. It’s important because it helps your browser load those websites much faster on subsequent visits.

2. How often should I clear my DNS cache?

You don’t need to clear your DNS cache regularly. It’s best used as a troubleshooting step when you can’t connect to a website, are seeing an old version of a site, or after a site migration.

3. Is it safe to clear the DNS cache?

Yes, flushing the DNS cache is completely safe and won’t harm your computer. It doesn’t delete any personal data, passwords, or files. Your computer will automatically start building a new cache as you browse the internet.

4. Will clearing the DNS cache log me out of websites?

No, clearing the DNS cache will not log you out of any websites. That information is stored in browser cookies, which are separate from the DNS cache.

5. Does flushing the DNS cache speed up the internet?

Flushing the DNS cache does not speed up your internet connection. The very first time you visit a site after clearing it, the page load might be a fraction of a second slower because your computer has to look up the IP address again.

Additional Resources on Caches in WordPress

We hope this article helped you learn how to easily clear your DNS cache on different devices. You may also want to see some articles on other types of cache in WordPress:

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

10 CommentsLeave a Reply

  1. I’m glad that you have clearly compared the DNS cache versus the browser cache. I often find the two confusing :-)
    thanks.

  2. We recently dealt with one of our customers that after changing the DNS records for the domain, he still saw the original website and we saw the new one. We couldn’t figure out what the problem was because we didn’t think it could be this cache (we cleared all other caches before). Only when we cleared the DNS cache using these commands under Windows, the pages were displayed correctly in the browser’s anonymous mode. Subsequently, they also worked in classic mode. So clearing the DNS cache saved us quite a bit of headache and looking for the problem elsewhere.

  3. So browser cache and DNS cache are two different things. I was really foolling myself and didn’t think about it. All I does is to clear my browser cache and thought it’s all. Thank you for the article.

  4. I have been in trouble for this mistake many times that is getting confused DNS cache with browser cache and vice versa.
    I updated the website and was not seeing the update on my browser.
    Then I cleared the browser cache and it worked well.
    having said that if we clear the DNS cache with command line , what time it takes to save new domain as cache to load the website faster?
    is it recommended to flush the DNS cache regularly?

    • Storing a new domain in the cache is a matter of first loading after clearing the cache. The domain is loaded and the DNS cache saves it. There is nothing more to it. As for some regular cache clearing, it’s not really necessary. Personally, I have never needed to delete the DNS cache, except in cases where, for example, the DNS records on the domain were changed. I also did not know this at first and looked for the error elsewhere. However, in my opinion, you do not need regular deletion, unless you are solving a problem where the DNS cache could play a role.

    • It will try to bring in the new content directly and unless there is another caching that causes a problem, you should see the correct site.

      You should not need to normally flush your DNS cache.

      Admin

      • Thanks wpbeginner for clearing confusion regarding clearing the DNS cache.
        I was confusing it with the browser cache and thought that the new updates will be shown only when we clear the browser cache.
        it means we can flush the DNS as and when we think we should.

  5. The articles I have read here in wpbeginner are exceptionally simple (without feeling simplified), clear, informative and most helpful. Thank you!

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.