Published by

Brink's Avatar

Join Date: Jul 2009
Posts: 21,954

How to Flush and Reset the DNS Resolver Cache in Windows

information   Information
When you type a web address into your web browser and press ENTER, you are sending a query to a DNS server. If the query is successful, the website you want opens; if not, you'll see an error message. A record of these successful and unsuccessful queries is stored in a temporary storage location on your computer called the DNS cache. DNS always checks the cache before querying any DNS server, and if a record is found that matches the query, DNS uses that record instead of querying the server. This makes queries faster and decreases network and Internet traffic.

Clearing the DNS cache to discard negative cache entries from the cache, as well as any other dynamically added entries, forces DNS to query a DNS server rather than using information stored in the cache. You might want to clear the DNS cache if you are moving and changing websites, or if you are receiving repeated errors when you know the web address you are typing is correct.

This tutorial will show you how to flush and reset the contents of the DNS (Domain Name System) client resolver cache when troubleshooting DNS name resolution problems in Windows.

You must be signed in as an administrator to be able to do the steps in this tutorial.

Note   Note
Resetting the DNS cache does not eliminate entries that are preloaded from the local Hosts file. To eliminate those entries from the cache, remove them from this file.

Automatically Flush and Reset DNS Resolver Cache with a VBS File

1. Click/tap on the download button below to download the file below.



2. Save the .vbs file to your desktop, and run it.

3. If prompted, click/tap on Open and Yes (UAC).
NOTE: If you like, you can stop getting the Open prompt by unblocking the .vbs file.

4. You will now see command prompts quickly open and close as it flushes and resets the DNS cache.

5. When it's finished, you can press any key or close the command prompt.

Click image for larger version

Manually Flush and Reset DNS Resolver Cache in Command Prompt

1. Open an elevated command prompt.

2. In the elevated command prompt, copy and paste the command below and press Enter. (see screenshot below)

ipconfig /flushdns

3. If successful, you will recieve the following message.

Windows IP Configuration

Successfully flushed the DNS Resolver Cache.

4. In the elevated command prompt, type the command below, and press Enter.

net stop dnscache

5. When the command above finishes, type the command below, and press Enter.

net start dnscache

6. When finished, you can close the elevated command prompt if you like.

Click image for larger version

That's it,