Resolver not always resolving hostnames

Hajimu UMEMOTO ume at FreeBSD.org
Sun Oct 22 15:59:57 UTC 2006


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
@@ -145,7 +145,7 @@ 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);
@@ -490,7 +490,7 @@ 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)
@@ -812,8 +812,9 @@ 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;
@@ -914,7 +915,7 @@ 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 @ Internet Mutual Aid Society Yokohama, Japan
ume at mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/


More information about the freebsd-current mailing list