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.
In this guide
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.
There are a couple of steps you can take to troubleshoot site visibility issues before you decide to clear your DNS cache.
- 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.
- 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.
In the following sections, you will find instructions for clearing the DNS cache on computer and laptop devices.
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:
Then, enter the following:
ipconfig /flushdns
and press the Enter key on your keyboard to clear the DNS cache:
If your computer is running on Windows 7, follow these steps:
- Click the Start button.
- Type cmd in the search bar.
- When the command prompt opens, type:
ipconfig /flushdns
- Press the Enter key on your keyboard, and repeat the process a few more times.
- Type
exit
and press the Enter key to close the command prompt.
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
.
💡
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.
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
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:
- Tapping on the URL field.
- Entering:
chrome://net-internals/#dns
and open that URL. - Tapping on DNS from the left sidebar.
- Tapping on the “Clear host cache” button:
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:
- Activate Airplane Mode.
- Wait for ten to fifteen seconds.
- Deactivate Airplane Mode.
Another way to clear your iPhone DNS cache is to restart it.