Windows Server 2008 R2 SP1 DNS Stops Resolving Names “Can’t find google.co.uk: Server failed”

Windows_Server_2008_R2_Logo

I use Windows Server 2008 R2 SP1 DNS to resolve my public names and precisely every two days I get “Can’t find google.co.uk: Server failed” messages and the usual “Internet Explorer cannot display the webpage” nonsense. This only happens when using root hints and not forwarders and only for few selected top level domains (.co.uk being one of them) Here is what the situation looks like when the DNS server is broken:

Windows_Server_2008_R2_SP1_DNS_Stops_Resolving_Names_Can't_find_google.co.uk_Server_failed_1

Ping returns “Ping request could not find host google.co.uk. Please check the name and try again” and nslookup throws error in title. Pretty annoying and so far the fix was to simply bounce the dns service – not elegant in any shape or form but highly successful!

Without going too much into detail the problem here is that Windows Server DNS ignores TTL (Time To Live) supplied by the root hints servers and overwrites it to be exactly 1 day. To fix this we have to set MaxCacheTTL registry key to decimal value of 172800 which equals to 2 days. Here is how to do it:

  • Run Regedit
  • Navigate to the following registry key:

  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNS\Parameters

  • Right click on Parameters, New, DWORD (32-bit) Value and then add the following information:

  • Value: MaxCacheTTL
    Data Type: REG_DWORD
    Data value: Hex 2a300 or Decimal 172800 (2 days)

  • Click OK and quit Regedit
  • Restart the DNS server
  • Screenshot to help you out:

    Windows_Server_2008_R2_SP1_DNS_Stops_Resolving_Names_Can't_find_google.co.uk_Server_failed_2

    If you cannot be bothered with the above you can download the registry key ready to be imported from here – Server_2008_R2_DNS_Fix.reg (right click, save as)

    This should be it, your DNS server will behave as expected from now on!

    Leave a Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.