diff -Naur asterisk.orig/utils.c asterisk/utils.c --- asterisk.orig/utils.c 2004-10-05 08:46:11.000000000 +0200 +++ asterisk/utils.c 2004-10-16 10:57:35.129361045 +0200 @@ -168,7 +168,14 @@ } if (!s || !*s) return NULL; - res = gethostbyname_r(host, &hp->hp, hp->buf, sizeof(hp->buf), &result, &herrno); + while(((res = gethostbyname_r(host, &hp->hp, hp->buf, sizeof(hp->buf), &result, &herrno)) !=0 + || !result + || !hp->hp.h_addr_list + || !hp->hp.h_addr_list[0]) + && herrno == TRY_AGAIN) + { + ast_log(LOG_WARNING, "temporary error resolving host name; retrying...\n"); + } if (res || !result || !hp->hp.h_addr_list || !hp->hp.h_addr_list[0]) return NULL;