Showing posts with label DNS. Show all posts
Showing posts with label DNS. Show all posts

Saturday, 18 March 2023

Windows 2012 R2 DHCP service locks up with no errors


If you are running a Windows 2012 R2 server that is a Domain controller with DHCP and DNS services on, you may encounter an issue where the DHCP service will lock up and stop responding with no errors logged in the Event log. This can cause problems for your network clients who rely on DHCP to obtain IP addresses and other configuration settings.

One way to diagnose this issue is to run "netstat -ano" on the server and check the output for UDP ports. You may notice that the DNS service is taking a lot of UDP ports, which can indicate that it is consuming too many resources and preventing other applications from using UDP.

This issue may be related to a security patch for DNS that was released by Microsoft in 2008 (MS08-037) and was included in Windows 2012. This patch was intended to prevent DNS cache poisoning attacks by randomizing the source port of DNS queries. However, this also had a side effect of increasing the number of UDP ports that DNS service can request, which can lead to port exhaustion over time.

The fix for this issue is to limit the number of ports that DNS service can request by using the following command:

dnscmd /Config /SocketPoolSize <value>

where <value> is a number between 0 and 10000. The default value is 2500, which may be too high for some environments. I normally use 100, as this seems ok for a small to medium business.

After running this command, you need to restart the DNS service for the changes to take effect. You can do this by using the following commands:

net stop dns
net start dns

Alternatively, you can use the Services console or PowerShell cmdlets to restart the service.

This should resolve the issue of DHCP service lock up and improve the performance and stability of your server

Microsoft Security Bulletin MS08-037 - Important | Microsoft Learn

Wednesday, 15 July 2020

CVE-2020-1350 | Windows DNS Server Remote Code Execution Vulnerability (Short Temp Fix)

A DNS Security risk has been found in Windows DNS that could / will be weaponised as a worm.


Short Term Fix Until you install the patch
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNS\Parameters 
  DWORD = TcpReceivePacketSize 
  Value = 0xFF00


The DNS service has to be restarted.

This workaround may break some DNS request, Microsoft says that standard DNS queries "should" be ok, but recommend diagnostic logging of the DNS server before applying to confirm.


The Default (also max) Value = 0xFFFF
The Recommended Value = 0xFF00 (255 bytes less than the max)

Once you have the security patch installed you can remove the "TcpReceivePacketSize" Registry key returning it all back to default.