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

Updated on July 19, 2018

DNS (Domain Name System) is like a phone book for the world wide web. Every website and domain is mapped to an IP address. When you type Google.com into your address bar, DNS does the mapping for you behind the scenes. Without DNS you would have to type something like 216.58.217.206 to get to Google. Wouldn’t that be fun!

We then have DNS cache. Just like caching on your WordPress site, DNS cache stores the IP addresses (or locations) you have recently visited locally on your computer. If DNS records become out of date or things change on the web server, you might have to clear DNS cache in order to grab the most up to date records.

DNS Cache Case Scenario

Here is a case scenario that actually happened to us on a client’s site the other day. The client suddenly complained about their images and CSS/Javascript not loading on their website. Their website was loading just fine for us and they ensured us they hadn’t made any recent changes. Upon inspecting their site with Chrome Devtools we could see that everything from their CDN subdomain (cdn.domain.com) were not loading correctly and reporting 404 errors.

So the first thing we did was ping the CDN subdomain to see if it was accessible to us. It returned a response just fine. We then ran their CDN URL through the free whatsmydns tool. This allows you to quickly check resolution on DNS records (such as the CDN CNAME) from multiple geographical locations. We wanted to ensure it was loading fine everywhere, beyond just our physical location and that it was resolving back to their CDN provider. And it was.

whatsmydns cname resolution

whatsmydns CNAME resolution

So after the above digging, we confirmed that there was a small change with their DNS provider which was still cached on the client’s end. So we had them clear their DNS cache locally on their computer, refresh the page, and everything started loading again on their WordPress site. Follow the steps below to clear DNS cache on your computer.

Clear DNS Cache Windows

To clear DNS cache on Windows, follow the steps below.

Step 1

Launch the start menu by pressing the Windows key and search for “CMD.” This should return the command prompt.

command prompt windows

Command Prompt in Windows

Step 2

In command prompt run the following command:

ipconfig /flushdns
ipconfig flush dns

ipconfig /flushdns

Step 3

You will then see a confirmation that it has successfully flushed the DNS resolver cache.

flushed dns resolver cache

Flushed DNS resolver cache

Clear DNS Cache Mac

To clear DNS cache on a Mac, follow the steps below.

Step 1

Click Applications and then “Utilities.”

Step 2

Launch the Terminal.

Step 3

Run the following command. You will need administrator access to do this.

sudo killall -HUP mDNSResponder && echo macOS DNS Cache Reset
clear dns cache mac

Clear DNS cache MAC

After clearing the DNS cache you can then try accessing the domain or website again that was having issues.

Clear Chrome DNS Cache

If you’re still having issues with an IP or domain resolving, you can also try clearing Chrome’s DNS cache, which is different than the local DNS cache.

Step 1

Input the following in your Chrome address bar and hit “Enter.”

chrome://net-internals/#dns
Chrome net internals

Chrome net-internals

Step 2

Click on “Clear host cache.”

Clear host cache in Chrome

Clear host cache in Chrome

Recommended tutorial: How to Clear Browser Cache for All Major Browsers

Was this article helpful?
No, or there was something off

Hand-picked related articles

Use WordPress?

Use WordPress?

Join 20,000+ others who get our FREE weekly newsletter with WordPress tips on how to drive more traffic and revenue to your business!

Consent

You have Successfully Subscribed!

Send this to a friend