Back to Support Domains and Email Clear the DNS Cache

Clear the DNS Cache

Occasionally, a site might not be accessible to you, but others can access it. This could happen if you recently made DNS changes to your domain, connected a domain, or let your domain expire momentarily.

What is DNS Cache?

The DNS cache is used by all operating systems to speed up DNS requests quickly, similar to how browsers keep a copy of websites visited so that they can be opened quickly during the next visit.

The DNS cache updates itself automatically, but it may be necessary to clear the DNS cache manually when a change to the DNS records occurs before the next DNS cache update.

Before you Clear your DNS Cache

There are a couple of steps you can take to troubleshoot site visibility issues before you decide to clear your DNS cache.

  1. Have you recently registered, connected, or transferred a custom domain to your WordPress.com site? Visit our guide on troubleshooting domain errors to ensure the domain is up and running.
  2. A simple, but often overlooked step, is to clear your browser’s cache first. Our guide on how to solve common browser issues is an excelent place to look.

Clearing the DNS Cache on Computers and Laptops

In the following sections, you will find instructions for clearing the DNS cache on computer and laptop devices.

Windows 8, 10, and 11

To enter the command prompt, press the Windows key (you can find it on the left side of the keyboard, between the Ctrl and Alt keys), and type msdos.

When you notice “Command Prompt” on the right side of it, click on “Run as administrator” as shown in the screenshot below:

Searching for msdos, then clickin Command Prompt, then clicking Run as administrator.

Then, enter the following:

C:\> ipconfig /flushdns

and press the Enter key on your keyboard to clear the DNS cache:

Windows 7

If your computer is running on Windows 7, follow these steps:

  1. Click the Start button.
  2. Type cmd in the search bar.
  3. When the command prompt opens, type:
C:\> ipconfig /flushdns
  1. Press the Enter key on your keyboard, and repeat the process a few more times.
  2. Type exit and press the Enter key to close the command prompt.
Clearing the DNS Cache on Windows 7

macOS

First, check your macOS version before executing any of the commands below.

To find your macOS version, click the Apple logo (top-left of your screen) and select “About This Mac.” It will bring up a small dialog showing various details of your Mac computer.

Depending on your Mac version, you may need to click “More info” or “Overview” to view the exact version number.

Next, launch the Terminal app from the Spotlight by pressing Command (⌘) + Space simultaneously and typing Terminal.

Launching the Terminal app

💡

Please note that you will need your password ready because these commands require elevated account permissions.

After you launch the Terminal app, copy & paste the exact command you’ll find below, but make sure it’s for your macOS version:

10.11 or newer
El Capitan, Sierra, High Sierra, Mojave, Catalina, Bigt Sur, Monterey, Ventura

sudo killall -HUP mDNSResponder

10.10
Yosemite

sudo discoveryutil udnsflushcaches

10.7, 10.8, and 10.9
Lion, Mountain Lion, Mavericks

sudo killall -HUP mDNSResponder

10.6
Snow Leopard

sudo dscacheutil -flushcache

10.5 or earlier
Leopard, Tiger, Panther, Jaguar, Puma, Cheetah, Kodiak

sudo lookupd -flushcache

After executing a relevant command from the list above, you can try opening the site you couldn’t access.

Linux

Given the many Linux distributions, we cannot provide specific commands for each. The best way to find out the exact steps for clearing the DNS cache on your Linux distribution is to check the website, forums, or documentation for the distribution you use.

The examples included below might or might not work on your distribution.

You might need to enter your account’s password to run these commands.

Below, we’ve listed examples for clearing the DNS cache for different Linux distributions:

dnsmasq

user@host$ sudo /etc/init.d/dnsmasq restart 

pdnsd

user@host$ sudo pdnsd-ctl empty-cache

nscd

user@host$ sudo service nscd restart

Alternatively, you can try the following:

user@host$ /etc/rc.d/init.d/nscd stop
user@host$ /etc/rc.d/init.d/nscd start

dns-clean

user@host$ sudo /etc/init.d/dns-clean restart

bind

user@host$ sudo /etc/init.d/named restart

Clearing the DNS Cache on Smartphones

Android

Android OS keeps the DNS cache for 10 minutes, and there is no default way to clear the DNS cache on Android.

However, you can try turning on Airplane Mode, waiting 15 seconds, then turning it off again. Please check your device manufacturer’s user manual for specific instructions regarding using the Airplane Mode.

Alternatively, you can clear the DNS cache from the Chrome browser app by opening it and:

  1. Tapping on the URL field.
  2. Entering: chrome://net-internals/#dns and open that URL.
  3. Tapping on DNS from the left sidebar.
  4. Tapping on the “Clear host cache” button:
Clearing the DNS Cache on Android from Chrome

iOS (Apple)

Clearing the DNS cache for your iPhone or iPad device can be performed in two ways.

The fastest way to do this is to toggle Airplane Mode:

  1. Activate Airplane Mode.
  2. Wait for ten to fifteen seconds.
  3. Deactivate Airplane Mode.

Another way to clear your iPhone DNS cache is to restart it.

Was this guide helpful for you?

Not quite what you're looking for? Get Help!

Copied to clipboard!