How to Fix Could not Flush the DNS Resolver Cache
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.
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.
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.
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”.
Does the Could not flush the DNS Resolver Cache” issue still persists? In such cases, one needs to take a look at the Windows logs in order to deduce what happened. Open Run Dialog box by typing ‘WIN+R’, click Ok Windows Logs Systems.
Thanks for your post. Where most others simply give details of conducting a ‘flushdns’ yours goes on to details how to correct the “Could not flush the DNS Resolver Cache: Function failed during execution” error message. Most useful, solved my issue.
If DNS Client Service is all “greyed out” and not let you change it status then you can do it through registry.
(1) Use regedit to navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Dnscache,
(2) Locate the Start registry key and change its value from 4 (Disabled) to 2 (Automatic)
(3) Reboot.
Even after following your directions, I am unable to start the service the DNS client service. The error message is Windows could not start the DNS client service on local Computer. Error 1068: the dependency service or group failed to start.
Any additional guidance would be much appreciated. Thank you
That’s a wounderful help raymond. It has sorted my two issues at one time. Thanks a lot
When you
“ipconfig /displaydns > cached-dns.txt”.
where can you find the file cached-dns.txt?
It will be in whichever folder was your current folder at the time, usually C:\users\yourname
ipconfig /displaydns > cached-dns.txt & cached-dns.txt will make the file open up once it’s completed.
Very useful, Raymond, I had issues with flushdns but I found this tutorial. Finally I solved them!
Thanks! for some strange reason the service was disabled. Thanks to your post, I could fix it quickly.
Thank you, Raymond! This was just what I needed.
Thank you SO much! Your fix me helped big time. You rock!
Thanks for this bro!!!
It work fine for me!!!
I searched all over till I found this link – and IT WORKED!
thanks so much.
Thank you Raymond so much.
I went to I don’t know how many sites and yours was the only place that gave me the information I needed. How to turn on the DNS Cache.
Your assistance was invaluable.
Thanks raymond This Amazing site
This was extremely helpful and very effectively written. Thank you. A lot.
the was excellent troubleshooting dude!!!!!!
Thank you so much for posting this. It helped me.
Thanks again.
Thanks it helps me to solve my problem.
thanks a lot for making my FLUSH DNS work
THANKS!!! worked for me!!! thank you very much
the only useful article in net thanks a lot
Thank you very much! I had this issue with Windows 7 and Vista and I never been able to find a solution until this moment :)
Didn’t know flushdns was depended on DNS Service.
Thanks !
Thanks, it worked for me.
i work for a tech support and this helped me a lot on call
This totally works for people with ‘limited or no connectivity problem’. I had this problem for almost a week and this single-paged article solved it!! Thank you for writing this article, Raymond!!
thanks for your solution…
It worked! Awesome.
Thanks raymond, this fixed my problem and i learned a new something thanks again
been looking for this.. thanks much! :)
lol this reminds me of something that happend a few days ago :D