Facing issue in dns timeout

yathish chandru yathish.anshu at gmail.com
Thu Jan 28 16:00:00 UTC 2010

Hi All,

I'm presently using uClibc- , in that the proble facing when I make
a call for getaddrinfo().

Occasionaly the DNS server is taking long DNS response, so after verifying
the resolv.c file,

Found that getaddrinfo,uClibc library and we found that it is hard coded to
10 Seconds. Attaching the file resolv.c from uclibc.
Please look at the function __dns_lookup() and grep for REPLY_TIMEOUT, so in
the function is in loop for MAX_RETRIES with REPLY_TIMOUT in the select
posix call.
So, since the  REPLY_TIMEOUT is hard coded, and I didn't find any function
to override the timeout. To reduce the timeout we need to recompile UClibc
 So, the RES_TIMEOUT which is avalable in resolv.conf is of no use.
Since, the problem in our application is the first dns request in
getaddrinfo is failing and the second one passes, so wanted to retry by
reducing the timeout but foud no option.
Is this the same behaviour in lthe latest uclibc. Please let us know on this

Thanks for the help.

More information about the uClibc mailing list