Instructions to clear DNS Cache with CMD command on Windows

Cache DNS helps you surf the web faster, but in a few cases when a website has changed DNS information but your computer still caches old DNS information, it will not be able to access that website.

In today's article, we will learn about how to clear the DNS Cache on Windows with the very simple CMD command.

I. Learn about DNS Cache

1. What is cache?

Picture 1 of Instructions to clear DNS Cache with CMD command on Windows

Cache is a cache that plays the role of storing processed data, making data access faster because it does not need to be compiled/processed again.

2. What is DNS?

Picture 2 of Instructions to clear DNS Cache with CMD command on Windows

DNS (Domain Name System) is a system of resolving domain names to IP addresses. With DNS, it's easier to access a website with an easy-to-remember name than entering a complicated and difficult-to-remember IP address into the browser.

For example: Facebook's IP address is 69.63.176.13, then instead of entering the above address, we type the address facebook.com into the browser, it will be faster and more convenient.

3. What is DNS cache?

Combined with the two terms above, Cache DNS can be understood as a file system that is stored on a user's personal computer when accessing a website for the first time. The browser will access the destination DNS server or the nearest DNS server and look up the IP address for the website to visit. From there, the corresponding IP address for the website will be saved on the user's computer for future visits without having to manipulate the query as before. This will help increase the page load time since the data is already pre-loaded in the user's machine.

4. Clear DNS Cache for what?

When a website moves to a server or changes its IP address, the chances of you getting a DNS error when accessing that website are quite high. Not only that, if you often visit websites with poor security system, you can also cause DNS cache system to fail. Then you will have connection problems. And that's when you need to clear the DNS cache to solve the problem.

II. Clear DNS Cache with CMD command on Windows

1. Simple DNS Cache Clearing with FlushDNS Command in CMD

Step 1: You press the Windows + R key combination to open the Run tool. Next, enter the cmd keyword and press Ctrl + Shift + Enter to open Command Prompt with administrative rights.

Picture 3 of Instructions to clear DNS Cache with CMD command on Windows

If there is a message like the picture, please click Yes.

Picture 4 of Instructions to clear DNS Cache with CMD command on Windows

Step 2: Type the following command and press Enter.

ipconfig /flushdns

Picture 5 of Instructions to clear DNS Cache with CMD command on Windows

After the message Successfully… appears successful!

Picture 6 of Instructions to clear DNS Cache with CMD command on Windows

2. Clear the DNS Cache with the command in PowerShell

Step 1: You press the Windows + R key combination to open the Run dialog box. Next, enter the keyword powershell => press Ctrl + Shift + Enter to open PowerShell with administrative rights. If a message appears on the screen, click Yes.

Picture 7 of Instructions to clear DNS Cache with CMD command on Windows

Step 2: Next, enter the following command and press Enter.

Clear-DnsClientCache

Picture 8 of Instructions to clear DNS Cache with CMD command on Windows

The command will clear the DNS cache and no error message will appear behind is successful.

Picture 9 of Instructions to clear DNS Cache with CMD command on Windows

3. Some commands to clear other DNS cache and renew another IP address

If you follow the above steps and the DNS cache has not been cleared, you can try the following commands in Command Prompt (cmd) with administrative rights:

  1. ipconfig /displaydns: Check current DNS records
  2. ipconfig /release: Exit the current IP address settings
  3. ipconfig /renew: Reset new IP address settings

With the instructions in the article, you can quickly clear the DNS Cache in CMD on Windows. Good luck!

Update 29 December 2021
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile