TechnitiumSoftware / DnsServer

Technitium DNS Server
https://technitium.com/dns/
GNU General Public License v3.0
4.25k stars 418 forks source link

Issues #227 is back on Windows 10/11 #345

Closed jy2e closed 2 years ago

jy2e commented 2 years ago

I am running ver 7.1 on Windows. After reboot, the DHCP scope is disabled just like as described in #227, but the server is indeed listening and DNS is operating normally.

ShreyasZare commented 2 years ago

Thanks for the feedback. Please check the logs for errors and post them here to know what went wrong. Also post details of the DHCP scope like the range that you have configured.

jy2e commented 2 years ago

Using the default interface with scope:

10.1.1.0 netmask 255.255.255.0 excluding 10.1.1.1-10.1.1.99

2021-12-16 00:34:55 UTC] [10.1.1.20:67] DHCP Server failed to activate scope: [masked] System.Net.Sockets.SocketException (10049): The requested address is not valid in its context. at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName) at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.Bind(EndPoint localEP) at DnsServerCore.Dhcp.DhcpServer.<>c__DisplayClass26_0.b__0(IPAddress key) in Z:\Technitium\Projects\DnsServer\DnsServerCore\Dhcp\DhcpServer.cs:line 888 at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at DnsServerCore.Dhcp.DhcpServer.BindUdpListener(IPEndPoint dhcpEP) in Z:\Technitium\Projects\DnsServer\DnsServerCore\Dhcp\DhcpServer.cs:line 862 at DnsServerCore.Dhcp.DhcpServer.ActivateScopeAsync(Scope scope, Boolean waitForInterface) in Z:\Technitium\Projects\DnsServer\DnsServerCore\Dhcp\DhcpServer.cs:line 970 [2021-12-16 00:34:55 UTC] DHCP Server successfully loaded scope: [masked]

If I wait until after Windows is done with startup and enable the scope and restart it, it works fine.

Is it having a problem with multiple physical network interfaces?

ShreyasZare commented 2 years ago

Thanks for the details. The SocketException message tells that the IP address that is to be bind to is not available on any local interface probably since Windows is still loading and the network stack may not be fully running yet when the DHCP server tries to bind socket.

A fix for this is to set the Technitium DNS Server service startup type to Automatic (Delayed Start). This will ensure that the service starts once the network is available.

jy2e commented 2 years ago

Fixed perfectly