Re: Resolver not always resolving hostnames

From: Hajimu UMEMOTO <ume_at_FreeBSD.org>
Date: Mon, 23 Oct 2006 00:59:48 +0900
Hi,

>>>>> On Sun, 22 Oct 2006 14:08:26 +0200
>>>>> Gábor Kövesdán <gabor_at_FreeBSD.org> said:

gabor> options attempts: 4 is the correct form and it did help to me. Thanks.

I found the timeout related fix in bind-9.3.3rc2:

> 2005.	[bug]		libbind: Retransmission timeouts should be
>			based on which attempt it is to the nameserver
>			and not the nameserver itself. [RT #13548]

It may solve your problem.  So, could you try this patch, instead?

Index: lib/libc/resolv/res_send.c
diff -u -p lib/libc/resolv/res_send.c.orig lib/libc/resolv/res_send.c
--- lib/libc/resolv/res_send.c.orig	Tue Aug  8 04:14:55 2006
+++ lib/libc/resolv/res_send.c	Mon Oct 23 00:36:41 2006
_at__at_ -145,7 +145,7 _at__at_ static int		send_dg(res_state,
 				int kq,
 #endif
 				const u_char *, int,
-				u_char *, int, int *, int,
+				u_char *, int, int *, int, int,
 				int *, int *);
 static void		Aerror(const res_state, FILE *, const char *, int,
 			       const struct sockaddr *, int);
_at__at_ -490,7 +490,7 _at__at_ res_nsend(res_state statp,
 				    kq,
 #endif
 				    buf, buflen, ans, anssiz, &terrno,
-				    ns, &v_circuit, &gotsomewhere);
+				    ns, try, &v_circuit, &gotsomewhere);
 			if (n < 0)
 				goto fail;
 			if (n == 0)
_at__at_ -812,8 +812,9 _at__at_ send_dg(res_state statp,
 #ifdef USE_KQUEUE
 	int kq,
 #endif
-	const u_char *buf, int buflen, u_char *ans, int anssiz,
-	int *terrno, int ns, int *v_circuit, int *gotsomewhere)
+	const u_char *buf, int buflen, u_char *ans,
+	int anssiz, int *terrno, int ns, int try, int *v_circuit,
+	int *gotsomewhere)
 {
 	const HEADER *hp = (const HEADER *) buf;
 	HEADER *anhp = (HEADER *) ans;
_at__at_ -914,7 +915,7 _at__at_ send_dg(res_state statp,
 	/*
 	 * Wait for reply.
 	 */
-	seconds = (statp->retrans << ns);
+	seconds = (statp->retrans << try);
 	if (ns > 0)
 		seconds /= statp->nscount;
 	if (seconds <= 0)


Sincerely,

--
Hajimu UMEMOTO _at_ Internet Mutual Aid Society Yokohama, Japan
ume_at_mahoroba.org  ume_at_{,jp.}FreeBSD.org
http://www.imasy.org/~ume/
Received on Sun Oct 22 2006 - 13:59:57 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:01 UTC