GetHostByName timeout

Discussion to talk about software related topics only.
Post Reply
dnishimura
Posts: 19
Joined: Fri Dec 19, 2014 3:07 pm

GetHostByName timeout

Post 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?
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: GetHostByName timeout

Post by rnixon »

I would get a wireshark trace and compare the one that works with the one that does not.
User avatar
pbreed
Posts: 1091
Joined: Thu Apr 24, 2008 3:58 pm

Re: GetHostByName timeout

Post 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
dnishimura
Posts: 19
Joined: Fri Dec 19, 2014 3:07 pm

Re: GetHostByName timeout

Post 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.
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: GetHostByName timeout

Post by dciliske »

Amusingly, we discovered this issue Monday. Sorry that this has given you a problem.
Dan Ciliske
Project Engineer
Netburner, Inc
dnishimura
Posts: 19
Joined: Fri Dec 19, 2014 3:07 pm

Re: GetHostByName timeout

Post 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.
Post Reply