How to clear DNS Cache

blog background image

Many computer operating systems use caching to store DNS lookup results.When a computer visits a website for the first time, it stores the website's DNS information in cache. The next time the computer visits a website, it looks in the cache to see if the website's information is present to use. This can cause problems if the website's DNS information has changed since the computer's last visit. Flushing the cache removes all the information stored in cache, forcing the computer to find the new DNS information for the website. Normally this is not a problem and accelerates network performance. However, when you are developing a website or configuring domain settings, your computer's DNS cache can get in the way, preventing you from accessing the correct site.

Windows operating systems (Windows 7, 8, 10 )

To clear the DNS cache on Microsoft Windows, follow these steps:

  1. Open a DOS command window. To do this, click Start, click Run, type cmd, and then press Enter.
  2. At the command prompt, type the following command and then press Enter:
    ipconfig /flushdns
  3. The DNS cache is now clear.

Mac OS X operating systems

To clear the DNS cache on Apple Mac OS X, follow these steps:

  1. Open a terminal window. To do this, click Applications, click Utilities and then click Terminal.
  2. At the command prompt, type the appropriate command for your Mac OS X version to clear the cache. For information about which command you should use for your Mac OS X version, please visit https://support.apple.com/en-us/HT202516.
  3. The DNS cache is now clear.

Linux operating systems

Many Linux distributions do not use DNS caching at the operating system level. Instead, applications (such as web browsers) maintain their own internal caches. To clear an application's DNS cache, often all you have to do is restart the application.

If your Linux system does use a DNS caching service, however, consult its documentation for instructions about how to clear the cache.

Google Chrome browser

The Google Chrome web browser maintains its own internal DNS cache. To clear it, follow these steps:

  1. Start Google Chrome.
  2. In the address bar, type chrome://net-internals/#dns. Google Chrome displays a list of hosts in its internal DNS cache.
  3. Click Clear host cache.
  4. In the address bar, type chrome://net-internals/#sockets.
  5. Click Close idle sockets, and then click Flush socket pools.

Flush DNS Cache in Ubuntu

When it comes to Terminal commands, Ubuntu is my favorite. There are so much GUI changes across the operating system recently, but terminal is my favorite place always.

Reset or Flush DNS cache with dns-clean command in Ubuntu Terminal window. Launch the Terminal and enter the following command to instantly flush dns to resolve any domain names latest IP address or changes you have made to your /etc/hosts file come into effect.

sudo /etc/init.d/dns-clean restart 

This should work very well on Ubuntu 14.04 LTS and Ubuntu 16.04 installs. If you are using Ubuntu 13.04 and earlier versions you may use the following commands as well to specifically reset, flush NSCD DNS Cache and flush DNSMASQ DNS Cache as well.

Launch Terminal and Enter the following command to Reset DNS Settings.

sudo /etc/init.d/networking force-reload

To Reset or Flush NSCD DNS Cache,

sudo /etc/init.d/nscd restart 

To Reset or Flush DNSMASQ DNS Cache,

sudo /etc/init.d/dnsmasq restart 

Flushing the cache removes all the information stored in the cache, forcing the computer to find new DNS information. (Sometimes all of this things not work if your ISP cache DNS )

Related Blog Post

Create, collaborate, and turn your ideas into incredible products with the definitive platform for digital design.

How to create cPanel backup from command line

12 December 2022

How to create cPanel backup from command line

This article explains how you can create cPanel backup from the command line, using your own username and password.

Read More
How to install Webuzo Panel on linux Server

12 December 2022

How to install Webuzo Panel on linux Server

Webuzo is a popular alternative to cPanel, a widely used web hosting control panel developed by cPanel, Inc.

Read More
What are NFT Domains?

02 February 2022

What are NFT Domains?

NFT domains are new web extensions that are deployed using ERC 721 and Polygon Network, except .zil which uses Zilliqa.

Read More
How to Delete a MySQL® Database

01 January 2022

How to Delete a MySQL® Database

This document describes how to manually delete a MySQL® database from a cPanel & WHM server. This is useful if, for exa

Read More
How to get Transfer Authorization Code from GoDaddy

11 November 2021

How to get Transfer Authorization Code from GoDaddy

To transfer your domain with us then must need EPP Code.

Read More

Got a question!

Contact us at