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.
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”.