Windows 10 DNS Cache is not just a DNS cache

Disabling the dnscache service in Windows 10 looks to bring a series of issues. I found out when I upgraded a machine from Windows 7 to Windows 10. That machine had the service disabled because it was used in a test environment where often DNS entries changed, and the default cache settings of Windows 7 were a nuisance (1 day for resolved entries, 15 minutes for non existent entries).

It looks now Windows 10 has a far shorter cache for names that cannot be resolved, down to 5 seconds, while the lifetime for resolved entries is still one day. But also other applications in Windows 10 look to rely on whatever the dnscache service does. For example, if it is disabled, the DNS server and domain assigned by a DHCP server are not displayed in a network connection properties details, nor appear in a netsh query.

DNS resolution will still work, mostly (most application works, domain access works, nslookup still works), but applications like the Windows Store will fail to open, with a cryptic hexadecimal error messages, and other “apps” may exhibit wrong behaviours. Microsoft troubleshooters won’t identify the issue.

I found out what the problem was when I tried to set the DNS servers through netsh – eventually, it told me it could not because the “service was disabled”.

If the default settings for the cache are not the right ones for a given situation, instead of disabling the service (which may not be possible in some version of Windows 10), it is better to addor change the settings stored in the registry under the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters:

  • MaxCacheTtl (DWORD) cache time for resolved names, in seconds. Default is 86400 (one day).
  • MaxNegativeCacheTtl (DWORD) cache time for “non existent” names, in seconds. Default is 5. Set to 0 to disable caching for NXDOMAIN answers.