TechnitiumSoftware / DnsServer

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

Address family not supported by protocol #102

Closed btafoya closed 4 years ago

btafoya commented 5 years ago

I get this error on a newly installation via the automated Ubuntu script on Ubuntu desktop 19.04 with IPv6 disabled.

System.Net.Sockets.SocketException (97): Address family not supported by protocol at System.Net.Sockets.Socket..ctor(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType) at DnsServerCore.Dns.DnsServer.Start() in Z:\Technitium\Projects\DnsServer\DnsServerCore\Dns\DnsServer.cs:line 1573 at DnsServerCore.WebService.Start() in Z:\Technitium\Projects\DnsServer\DnsServerCore\WebService.cs:line 4743 at DnsServerApp.Program.Main(String[] args) in Z:\Technitium\Projects\DnsServer\DnsServerApp.NETCore\Program.cs:line 42

ShreyasZare commented 5 years ago

Thanks for the feedback. The DNS Server default setting is to listen on port 53, tcp & udp for both IPv4 and IPv6. Since you got IPv6 disabled at OS level, the software is not able to bind to IPv6 address.

You can fix this by logging into DNS server web console and removing "::" address from the DNS Server Local Addresses settings. Once the ipv6 address is removed, the DNS Server wont generate this error in logs.

Do let me know if this worked.

ShreyasZare commented 5 years ago

I just inspected the code in detail and it seems that the server will fail to start as this error is not handled. I will update this code section to correctly handle this scenario.

For now, you could run the DNS Server on another machine with IPv6 enabled and remove the "::" address from the DNS Server Local Addresses settings. Then you can copy the dns.conf file from this machine to your current Ubuntu machine so that the server starts without IPv6.

Do let me know if this worked.

ShreyasZare commented 4 years ago

Technitium DNS Server v4.1 is now available that fixes this issue.

btafoya commented 4 years ago

Thank you! It is working perfectly!