--- jbsockets.c.orig Wed Dec 17 17:34:40 2003 +++ jbsockets.c Fri Apr 7 14:32:06 2006 @@ -780,6 +780,7 @@ { struct sockaddr_in inaddr; struct hostent *hostp; + unsigned int dns_retries = 0; #if defined(HAVE_GETHOSTBYNAME_R_6_ARGS) || defined(HAVE_GETHOSTBYNAME_R_5_ARGS) || defined(HAVE_GETHOSTBYNAME_R_3_ARGS) struct hostent result; #if defined(HAVE_GETHOSTBYNAME_R_6_ARGS) || defined(HAVE_GETHOSTBYNAME_R_5_ARGS) @@ -819,7 +820,9 @@ hostp = gethostbyname(host); pthread_mutex_unlock(&gethostbyname_mutex); #else - hostp = gethostbyname(host); + while ( NULL == (hostp = gethostbyname(host)) && (h_errno == TRY_AGAIN) && (dns_retries++ < 10) ) + log_error(LOG_LEVEL_ERROR, "%u. timeout while trying to resolve %s. Trying again.", + dns_retries, host); #endif /* def HAVE_GETHOSTBYNAME_R_(6|5|3)_ARGS */ /* * On Mac OSX, if a domain exists but doesn't have a type A