netduino / Netduino.IP

The shiny new TCP/IP Stack for .NET Micro Framework. [Technical Preview]
http://forums.netduino.com/index.php?/forum/29-netduinoip-technical-preview/
Apache License 2.0
16 stars 7 forks source link

DNS resolution fails if the first DNS server is unreachable #2

Closed NameOfTheDragon closed 9 years ago

NameOfTheDragon commented 9 years ago

When multiple DNS servers are specified and the first server in the list is unreachable (e.g. it is offline) then DNS lookup fails instead of trying the next server.

Expected result: All DNS servers in the list should be tried before throwing an exception.

Resolving.
Ready.
ConnectionHandler available
[Network Server    ] Waiting for valid IP address
[Network Server    ] Found 1 network interfaces - details as follows...
[Network Server    ] Network interface: 0
[Network Server    ]   Interface type: 6
[Network Server    ]   IPv4 address: 192.168.0.41
[Network Server    ]   Default gateway: 192.168.0.1
[Network Server    ]   Subnet mask: 255.255.255.0
[Network Server    ]   DNS servers:
[Network Server    ]     192.168.0.26
[Network Server    ]     192.168.0.1
[Network Time      ] Attempting to st the time from pool.ntp.org
 Uncaught exception 

A SocketException is thrown when pool.ntp.org fails to resolve on the first server, which was turned off. The second server in the list is the ADSL router and was available and working at the time. Other hosts on the network were able to successfully resolve pool.ntp.org.

netduino commented 9 years ago

Thank you for letting us know about this. The DNS timeout was set to Infinite, and has now been changed to 5 seconds per DNS server query (with failover to secondary DNS servers).

This is fixed for the Netduino.IP v1.0.1 release.