Page 1 of 1
GetHostByName timeout
Posted: Mon Nov 09, 2015 11:15 am
by dnishimura
I'm getting a GetHostByName timeout when trying to resolve a hostname from an internal DNS server, but it works fine with OpenDNS. However, other devices, such as PCs and laptops, are able resolve a hostname from the internal DNS server on the same ethernet port. Any insights or ideas on how to troubleshoot this?
Re: GetHostByName timeout
Posted: Mon Nov 09, 2015 1:02 pm
by rnixon
I would get a wireshark trace and compare the one that works with the one that does not.
Re: GetHostByName timeout
Posted: Mon Nov 09, 2015 5:08 pm
by pbreed
Obvious question is does the netburner know the address of this server?
Static or DHCP addresses?
Is the internal DNS server on the same subnet? If not does the netburner have a geateway?
What are you using for a timeout value?
(Its in ticks not seconds)
Do you have the IPAddresses orders to the call correct?
IE
GetHostByName( "nameyourlookingfor.com",&addess_to_put_result_into,ip_addresses_of_your_local_server, TICKS_PER_SECOND *10);
Paul
Re: GetHostByName timeout
Posted: Tue Dec 08, 2015 6:16 pm
by dnishimura
I've finally tracked down the issue. GetHostByName sets both the destination and src port to 53 in the UDP packet. While this is fine in the general case, many organizations with stringent internal policies may have problems with things using well known ports as a listening port or return port.
Once I modified nburn/system/dns.cpp to use a source port outside of the range, such as port 53380, everything worked fine. I've observed that every other DNS client I've used uses a source port outside of the well-known port range as the source port as well. In my opinion, the source port should be configurable.
Thanks.
Re: GetHostByName timeout
Posted: Wed Dec 09, 2015 11:17 am
by dciliske
Amusingly, we discovered this issue Monday. Sorry that this has given you a problem.
Re: GetHostByName timeout
Posted: Wed Dec 09, 2015 4:31 pm
by dnishimura
Glad the issue is being addressed. I've patched dns.cpp in the meantime. I'm sure you're already aware, since SetTimeNTPFromPool() calls GetHostByName(), it prevents it from working properly as well.
Thanks again.