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?

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

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?

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

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.

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

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

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

Step 2: Type the following command and press Enter.

ipconfig /flushdns

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

After the message Successfully… appears successful!

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

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.

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

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

Clear-DnsClientCache

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

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

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

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!

3.5 ★ | 2 Vote