Fix “Could not flush the DNS Resolver Cache: Function failed during execution” When Flushing DNS

The ipconfig tool that is built-in to the Windows operating system is very useful for administrators to display all TCP/IP network configurations. It can also be used to test the computer’s connectivity between the DHCP server and the workstation by using the /release and /renew command line options. Most normal computer users don’t really need to use this tool but there is actually a very useful command line option which is the “flushdns“.

The ipconfig tool describes the flushdns option as purging the DNS resolver cache. By default every Windows computer is configured to automatically cache name queries resolution because the IP address attached to a domain name doesn’t normally change very often. Hence caching the DNS will save a little bit of your bandwidth and time by not having to check with a DNS server every time you visit a website.

The flushdns command line option in ipconfig merely clears the DNS cache on your computer. This is particularly useful when a website’s IP address has changed and you’re still hitting on the old one because the DNS cache for the domain name hasn’t expired. Flushing your computer’s local DNS cache can be done by typing the command below in command prompt.

ipconfig /flushdns

It is possible that you’re getting an error message “Could not flush the DNS Resolver Cache: Function failed during execution” after typing the command above.

could not flush the dns resolver cache

This problem is most likely caused by a service called DNS Client being disabled on the computer which by default is automatically started with Windows. To re-enable the DNS Client service:

1. Press WIN+R to bring up the Run dialog box.

2. Type services.msc in Run and click OK.

3. Look for DNS Client in the name column and double click on it.

4. If the startup type is disabled, simply click on the drop down menu and select Automatic. Click Apply and followed by clicking on the Start button. Alternatively you can also reboot your computer and the DNS Client service will automatically start by itself.

start dns client

If you are having trouble following the steps above, simply download this batch file and run it as administrator. It will automatically configure DNS Client to automatically start with Windows and instantly start the service.

If for some unknown reason the DNS Client service is unable to start, any errors are logged in Event Viewer because the service runs under the Network service account. Press WIN + R, type eventvwr, click OK, expand Windows Logs > System.

"event

There is a debate whether to disable or enable the DNS Client service permanently. Some argue that disabling the DNS Service will save some memory usage making the computer faster, while enabling it will cause the websites to load faster. After a simple test, we find that the the DNS Client service uses up only 256KB of memory. So disabling it shouldn’t really give you any noticeable performance boost and it requires an additional round trip to check with the DNS servers for resolving a domain name to IP address.

Additional Tip: The resolved DNS cache can be viewed by typing the command ipconfig /displaydns. If the list is too long for the command prompt to show all the DNS cache, you can export all the results by using the greater-than sign which is >. An example command would be “ipconfig /displaydns > cached-dns.txt”.

You might also like:

27 Comments - Write a Comment

  1. Uyl 6 months ago
    • HAL9000 6 months ago
  2. Cosmin 13 7 months ago
  3. Jose 2 years ago
  4. markfilipak 2 years ago
  5. Kris 2 years ago
  6. Hernani Gersava 3 years ago
  7. Neal K 5 years ago
  8. Debbie 5 years ago
  9. Thanks Raymond 6 years ago
  10. Varvaroushka 6 years ago
  11. hrinidhi 6 years ago
  12. Vicky 7 years ago
  13. pankaj 7 years ago
  14. vins 7 years ago
  15. manse 7 years ago
  16. kol 7 years ago
  17. Ahmed 7 years ago
  18. enli 7 years ago
  19. Ali 7 years ago
  20. richard 8 years ago
  21. Lucas 8 years ago
  22. David 8 years ago
  23. Debbie 8 years ago
  24. shettos10 8 years ago
  25. jayl 8 years ago
  26. Infest 8 years ago

Leave a Reply

Your email address will not be published. Required fields are marked *

Note: Your comment is subject to approval. Read our Terms of Use. If you are seeking additional information on this article, please ask in our forum or contact us directly.