Flush DNS – How and why to clear your DNS cache

  1. What is my DNS?
  2. Flush DNS – How and Why to Clear

Your DNS Cache

If you’re having trouble accessing a webpage or using an online service, your device may have cached an outdated DNS record that needs to be manually cleared or reset. This is a process known as flushing your DNS cache and is easy to do, but the steps you need to follow will depend on the device you’re using.

If

you are familiar with using your system’s command line or terminal, listed below are the commands to flush your DNS for the most popular operating systems

.

If you’re not sure how to use these commands, you can find more detailed instructions that include screenshots of each step in the dedicated section for each version.

Why do you need to flush the DNS cache?

DNS records are cached locally on your computer, phone, tablet, or even smart TV. These devices will automatically cache IP addresses and other DNS records when they make a DNS lookup request the first time you visit or use them.

DNS

results are cached to speed up subsequent requests to the same website or service without the need to perform an additional DNS lookup. Sometimes old results will be cached for a long period of time and your device will continue to try to communicate with the IP address of the previous result even though they may have changed since then, this can often result in you not being able to access a website, game server or other online service as you would expect.

The amount of time a result is cached on your local device is known as TTL (Time-to-Live). Your device will not attempt to look up an updated DNS server record if this time has not yet expired. The TTL of DNS records is configured by the domain administrator and can last from a few minutes to 3 days or even longer in some cases. For this reason, problems can arise if DNS changes have been made to the DNS settings of domain names and your system has a cached result that does not yet need to be renewed. If this occurs, then the cache should be cleared so that your system knows how to communicate with the new server.

How do you know if you need to flush your DNS cache?

There are some signs that may indicate that you need to flush your DNS, some of them include: DNS

records mismatch: You can easily check DNS propagation globally for any domain name, and if your local system doesn’t return the same results, this may indicate that you need to flush your DNS.

If you’re a website owner and you’ve recently made changes to your domain, name servers, or DNS hosting provider settings and you’re having trouble accessing your own website, you’re likely running into DNS caching issues and need to flush your DNS cache.

Can’t access websites: If you can’t

access a website, which you normally don’t have problems with, this may indicate a DNS cache issue.

Page not found

errors: If you receive a 404 page not found error, it may mean that the page has simply been deleted. However, if you know that the page exists, as it is your own website, this may mean that you are connecting to an old server that does not have the page you are looking for. This is usually the problem when you have changed domains or hosting provider.

View old versions of a website

: If changes have been made to a website’s DNS settings, it might not be connecting to the new version. If this is the case, flushing your DNS can help resolve the issue.

As you can see, there are a variety of reasons for needing to clear your DNS cache, so it’s worth clearing your DNS cache to remove it as a potential point of failure.

What happens when I flush the DNS cache?

When you clear the DNS cache, the appliance will purge all local DNS records that have been previously resolved and cached, regardless of the TTL set in the record. This means that when you access a website or service next time, you’ll need to perform a new DNS lookup to get this information and it will once again be cached for future requests.

Is it safe to flush the DNS cache?

Yes, it is safe to flush your DNS. Some people worry about clearing or resetting their DNS cache, or whether doing so too often will cause some sort of damage. This may be because some operating systems require administrator permission or elevated privileges to do so. However, you don’t need to worry as it is perfectly fine and won’t cause any damage to your system or device.

It should be noted that when you flush your DNS cache again, the

first time you re-access a website or service after you’ve done so will mean that a full DNS lookup will be necessary, which will add a slight delay to the connection and can make a page appear to load more slowly. This is usually a very small delay, and most people wouldn’t be able to notice.

Can flushing DNS improve network performance and speed up the Internet?

Flushing your DNS cache usually doesn’t speed up your internet connection, however, it’s possible that doing so could make certain sites or services faster.

If service providers have moved your hosting infrastructure to higher-performing servers or networks and you have a cached DNS record that still points to an old server, by flushing your DNS cache you’ll be able to start accessing the new server or network without having to wait for the records to expire naturally.

Some service providers use DNS servers that return various results for fault tolerance, routing, and performance reasons. These results may depend on where you are located and, under certain circumstances, you may receive results incorrectly or when maintenance was being performed in a certain region, and you are assigned to a region that is not optimal. When this happens, at least getting slower access is better than no access at all. If this is the case, flushing your DNS cache could cause you to connect to a closer server, resulting in faster access and improved performance.

Flushing DNS in Microsoft Windows

Flushing

the DNS cache in Windows is easy to do, but depending on the version of Windows

you’re running, the steps will vary slightly

.

Also, you’ll need to make sure you have administrator permissions to flush the DNS cache in Windows, as this is a system-level command.

Windows 10

Flushing DNS cache in Windows 10 is a very easy process. Due to system security permissions, you must ensure that you run the command prompt as an administrator user.

Make sure you’re on

  1. the Windows 10 desktop
  2. . Right-click on the start menu and

  3. choose Command Prompt (Administrator)
  4. from the menu. Type the command ipconfig /

  5. flushdns

Some additional commands that can be run from the command prompt to reset your network connection and renew your IP address that can also help resolve issues are:

ipconfig /release – Releases the IP address assigned to network connections

.

ipconfig /renew – Renew your network connection and get a new IP address

. Windows 8 / Windows 8.1 Flushing the DNS cache in Windows 8 and

Windows 8.1

is a very easy process. Due to system security permissions, you must ensure that you run the command prompt as an administrator user.

Make sure you’re on the Windows

  1. 8
  2. Start screen.

  3. Just type cmd and
  4. the Windows search bar will appear on the right side with the search results.

  5. Right-click Command Prompt and click Run as administrator
  6. Type the command ipconfig /flushdns

Windows

Vista / Windows 7

Flushing DNS in newer versions of Windows is almost as easy as in previous versions, but due to Microsoft’s security additions, you must run the command prompt with Administrator Privileges.

Click the Start button and navigate to the command

  1. prompt (Start > All Programs > Accessories >
  2. Command Prompt) Make sure to right-click on

  3. the Command Prompt app and choose “Run as administrator” Type
  4. the

  5. command ipconfig /flushdns

Note: It is also possible to type cmd in the search field of the Windows Vista/Windows 7 start menu and then right-click on the result .exe cmd instead of having to navigate through the various submenus.

Windows

98/NT/2000/XP

Flushing DNS in Windows is an easy process,

below are the steps that need to be executed if you want to clear your DNS cache.

  1. Open the command prompt (Start > Run > cmd.exe > OK).
  2. Type the command ipconfig /flushdns

Flushing DNS on Apple Mac

Flushing

DNS on MacOS and Mac OS X is an easy process, but the steps taken will depend on the version of MacOS you are running.

The first step you need to do is to identify which version of MacOS you are running.

  1. Click the Apple icon at the top left of the
  2. screen.

  3. Select “About This Mac.”
  4. Look at the name and version of MacOS you are running and proceed to the section of your version below.

Note: You will need administrator permissions to flush the DNS cache on Mac, this can be done by running the commands as root or using sudo before each command

. macOS 12 – Monterrey If you are running MacOS

12

, you need to follow the steps below:

  1. Open the Finder and navigate to the Applications > Utilities directory and open the Terminal application
  2. .

  3. Type the command sudo killall -HUP mDNSResponder
  4. .

  5. Enter your password when prompted.

macOS 11

– Big Sur

If you are running MacOS 11, you need to follow the steps below

:

Open Finder and navigate to the Applications > Utilities directory and open the Terminal application. Type the command sudo killall -HUP mDNSResponder. Enter your password when prompted. macOS 10.15 – Catalina

If you are running MacOS 10.15, you need to follow the steps below:

Open Finder and navigate to the Applications > Utilities directory and

  1. open the Terminal application
  2. .

  3. Type the command sudo killall -HUP mDNSResponder

.

  1. Enter your password when prompted
  2. . macOS 10.14 – Mojave If you are running MacOS 10.14, you need to follow the steps below: Open the Finder and navigate to the Applications > Utilities directory and open the Terminal application.

  1. Type the command sudo killall -HUP mDNSResponder
  2. .

  3. Enter your password when prompted

. macOS 10.13 – Sierra Alta

If you are running MacOS 10.13, you need to follow the steps

below:

Open the Finder and navigate to the Applications > Utilities directory and open the Terminal application. Type the command sudo killall -HUP mDNSResponder. Enter your password when prompted. macOS 10.12 – Sierra

If you are running MacOS 10.12, you need to follow the steps below:

  1. Open Finder and navigate to the Applications > Utilities directory and open the Terminal application
  2. .

  3. Type the command sudo killall -HUP mDNSResponder

.

  1. Enter your password when prompted.

Mac OS X 10.11 – El Capitan If you are running Mac OS X 10.11, you should follow the steps below:

  1. Open the Finder and navigate to the Applications > Utilities directory and open the Terminal application
  2. .

  3. Type the command sudo killall -HUP mDNSResponder
  4. .

  5. Enter your password when prompted

. Mac OS X 10.10

– Yosemite If you are running Mac OS X 10.10

,

you need

to follow the steps below: Open Finder and navigate to the Applications > Utilities directory and open the Terminal application.

  1. Type the command sudo discoveryutil udnsflushcaches
  2. .

  3. Enter your password when prompted
  4. . Mac OS X 10.9 – Mavericks If you are running Mac OS X 10.9, you need to follow the steps below:

  5. Open Finder and navigate to the Applications > Utilities directory and open the Terminal

application.

  1. Type the command sudo killall -HUP mDNSResponder
  2. .

  3. Enter your password when prompted.

Mac OS X 10.8 – Mountain Lion If you are running Mac OS X 10.8, you should follow the steps below:

  1. Open the Finder and navigate to the Applications > Utilities directory and open the Terminal application
  2. .

  3. Type the command sudo killall -HUP mDNSResponder
  4. .

  5. Enter your password when prompted

. Mac OS X 10.7 – Leon

If you are running Mac OS X 10.7,

you need

to follow the steps below:

  1. Open Finder and navigate to the Applications > Utilities directory and open the Terminal application
  2. .

  3. Type the command sudo killall -HUP mDNSResponder
  4. .

  5. Enter your password when prompted

. Mac OS X 10.6

– Snow Leopard If you are running Mac OS X 10.6

, you need to follow the steps below:

Open Finder and navigate to the Applications > Utilities directory and open the Terminal application.

  1. Type the command sudo dscacheutil -flushcache
  2. .

  3. Enter your password when prompted
  4. . Mac OS X 10.5.1 – Leopard and earlier If you are running Mac OS X 10.5.1 or lower, you need to follow the steps below:

  5. Open Finder and navigate to the Applications > Utilities directory and open the Terminal

application.

  1. Type the command sudo lookupd -flushcache
  2. .

  3. Enter your password when prompted.

Other operating systems

Emptying

For Linux systems, including Ubuntu, Debian, Red Hat, Fedora, CentOS, etc., flushing your DNS cache

will depend on how your system is configured and which service is responsible for DNS caching

. systemd

If you are running a system that uses systemd like Ubuntu or other Debian-based systems, to flush your DNS cache, you will need to

run the following. Open a command terminal (either as root or run the following with sudo). Run the command systemd-resolve -flush-caches Optional.

  1. You can verify that it ran successfully by running the command: systemd-resolve -statistics

NSCD – Name Server Cache Daemon

If you are running the nscd Name Service Cache daemon and want to flush your DNS cache, you will need to do the following

.

  1. Open a command terminal (either as root or run step 2 with sudo).
  2. Run the /etc/init.d/nscd restart command

Other ways

to flush the DNS cache

Sometimes the standard way to flush your DNS cache is not possible, for example, if you don’t have administrator permissions. Fortunately, there are a few other ways to achieve the same result that can often be easier to do.

Restart your device: If you are having problems with any of the other solutions mentioned on this page, you can try restarting your device. This may not work in all cases, but it’s definitely worth a try.

Reset your network connection: You can try disconnecting and reconnecting

a Wi-Fi connection, or disconnecting and reconnecting an Ethernet cable to try to reset your network connection

.

Change DNS server: You can consider using one of the popular global DNS servers that provide many benefits, including speed and security, as well as allowing you the ability to ask them to clear your cache.

Hosts file: While making changes to your system’s hosts file won’t flush your DNS cache, it will allow you to force a certain domain name to resolve to a certain IP address. This can be useful as a temporary solution, but should not be relied upon in the long run.

How to clear the cache of public DNS resolvers

If you are using a DNS

server that allows you to inform them that a record is outdated and needs to be cleared, then they can provide a web interface to do so

.

Some of the popular providers that all you should do this are listed below:

Cloudflare 1.1.1.1

Cloudflare

offers a popular public DNS resolver known as

1.1.1.1 that allows you to clear the DNS cache they have.

  1. Visit the Cloudflare Purge Cache tool page. Enter
  2. the

  3. domain name for which you want to clear the cache
  4. .

  5. Choose the type of record, typically it will be an A record or a CNAME record.

Google Public DNS 8.8.8.8 Google’s public

DNS

resolver also allows you to clear the cache of any domain name in your cache.

  1. Visit Google’s Flush public DNS cache page
  2. .

  3. Enter the domain name for which you want to clear the cache
  4. .

  5. Choose the type of record, typically it will be an A record or a CNAME record.

OpenDNS OpenDNS

public DNS servers allow you to clear the shared cache of domains that have cached all your users

. Visit the

  1. OpenDNS CacheCheck
  2. page. Enter the domain name

  3. for which you want to clear the
  4. cache.

  5. Enter the CAPTCHA code
  6. . Click the “

  7. Verify this domain”
  8. button. Once the cache

  9. has been checked, click the “refresh cache” button at the bottom of the page.

Contact US