Internet

How to Flush DNS Cache on Windows and Linux

Flush DNS Cache on Windows and Linux

DNS cache is simply a temporary database of the recent DNS Lookups your system has performed. You need to flush DNS cache of your system to ensure that it has the latest and correct list of IP Addresses of the Hostnames.

By doing so our system stores the IP Address of a hostname which we frequenty visit. Now, when we visit that hostname again, DNS Lookup is not performed and the IP Address is imply obtained from the DNS Cache. This in turn speeds up website loading time as the time required for DNS Lookup no longer plays a role.

However, if you’re a Webmaster or a Web Developer and have moved to a new host, you may have to clear your DNS Cache. This is because in your local DNS Cache, the IP Address of a hostname corresponds to A, but it is actually pointing to B.

So, whenever you change your hosting provider, or in other words we can say that whenever you change the nameserver of your domain, flushing the DNS cache from your PC is necessary.

Even if you don’t perform the following step, the website will load properly for everyone else, but on your system it will give an error because of the wrong entry in the DNS Cache.

How to Flush DNS Cache on Windows?

The process to Flush DNS Cache in Windows 10 is pretty straightforward. All you need to do is to type the command ipconfig /flushdns on either the Command Prompt or on the Windows PowerShell. Here are the exact steps to do so.

1) Open Command Prompt

There are various ways to open the command prompt on Windows. The simplest way is to press the start button and type cmd.

Press Start and Type Cmd

Now click on Command Prompt to open it.

Alternatively, you can open CMD via Run. Simply press Win+R and the following dialogue box will open.

Windows Run

Now, type Cmd and press OK. This will open the command prompt.

 

2) Type  ipconfig /flushdns

Inside the Command Prompt window, type ipconfig /flushdns like shown in the image below.

Flush DNS Cache via Command Prompt

3) Press Enter

After pressing Enter, the following message will be displayed:

      Windows IP Configuration

      Successfully flushed the DNS Resolver Cache.

Hence, this confirms that the DNS cache has successfully been cleared from your Windows PC.

How to Flush DNS Cache on Linux?

If you use a Linux Distro, you’ll have to follow the steps given below to Flush DNS Cache from your System.

1) Open Terminal

Press Ctrl+Alt+T to open the Terminal Window

2) Type the following command

Type one of the following commands:

      sudo /etc/init.d/nscd restart

OR

       service nscd reload

OR

      service nscd restart

3) Press Enter

That’s’ it! That’s all you have to do to clear the DNS Cache on Linux.

Brandan Collins

Author Brandan Collins

More posts by Brandan Collins

Leave a Reply