65.9K
CodeProject is changing. Read more.
Home

Quick Fix – Windows 2012 R2 DNS Server – Keeps Crashing

starIconstarIconstarIconstarIconstarIcon

5.00/5 (1 vote)

Dec 4, 2016

Ms-PL

2 min read

viewsIcon

17592

Did your DNS server on Windows Server 2012 R2 suddenly start crashing? If so, here is a simple workaround.

Did your DNS server on Windows Server 2012 R2 suddenly start crashing? If so, here is a simple workaround.

Sometime ago, I was rebuilding some DNS servers and noticed that after a few seconds, the DNS Server service would suddenly shutdown. Even while I was in the DNS Manager console, making some changes, I would suddenly get hit with a “DNS Service is unavailable” error message. So I went through all the standard troubleshooting tech —-

  1. Enabled logging of errors and warnings in DNS console — nothing logged in Windows Event Log apart from “DNS Server service shut down unexpectedly. It has done this N time(s).”
  2. Watched the “dns.log” file in “C:\Windows\System32\DNS” folder – it was always 0 KB in size and empty.
  3. Watched the Event Viewer and initially did not find anything useful.

I have this old habit that when I am looking at something as puzzling as this, I would clear out all the Event Log logs, restart services and stuff and watch for the log entries that would appear. While I was doing this, I started noticing a pattern of “Windows Error Reporting” entries appear along side the [DNS Service stopped…] message. Everytime. I looked at a few of these and sure enough, they were of the “dns.exe” (the process that runs the DNS Server Service) crashing.

So I looked on the web and found this thread on TechNet Social. The message that my machine was logging was fairly identical to the one on that post, except for the GUIDs.

The article’s marked answer gave two solutions:

  1. Configure DNS Server to load from Registry or
  2. Remove KB 2919355

Now, I am a little loath to remove installed KBs unless they are actually recalled by Microsoft, specifically because the same fix can flow back in at a later point of time through some other hotfix, service pack, etc. So it is pretty pointless to uninstall one of these unless it is absolutely necessary.

The other solution provided made sense to me for two reasons:

  1. I was not using Active Directory, so I had only one of two options to choose from: Registry or File.
  2. Most importantly — I had actually configured the DNS Server to load from “File” as part of my rebuild.

There are three ways to do what I did next:

  1. Fire up “dnsmgmt.msc” console, right click on the DNS Server, open Properties, go to the Advanced tab and select “From registry” for “Load zone data on startup” option.
  2. Open an elevated Command Prompt, fire the command: (the “2” is for “Load from Registry”)
    C:\> DNSCMD /Config /BootMethod 2
  3. Open the Registry, navigate to this Key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNS\Parameters

    There, find the setting on the right-hand side pane called “BootMethod”. Double-click it and set the value to the number [2].

Sure there is also a PowerShell way to do this using Set-DNSServerSetting, but there is no documentation on how to use this method.

After performing the change, restart the DNS Server service and you are done. No more crashes!