From owner-freebsd-stable@FreeBSD.ORG Mon Feb 27 15:20:36 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7BFAF16A420; Mon, 27 Feb 2006 15:20:36 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (comp.chem.msu.su [158.250.32.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 18B7843D66; Mon, 27 Feb 2006 15:20:24 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.13.3/8.13.3) with ESMTP id k1RFJtb5037360; Mon, 27 Feb 2006 18:19:55 +0300 (MSK) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.13.3/8.13.3/Submit) id k1RFJtGi037359; Mon, 27 Feb 2006 18:19:55 +0300 (MSK) (envelope-from yar) Date: Mon, 27 Feb 2006 18:19:54 +0300 From: Yar Tikhiy To: Hajimu UMEMOTO Message-ID: <20060227151954.GV6435@comp.chem.msu.su> References: <20060218012029.e146e2ff.rosti.bsd@gmail.com> <20060219104912.GB20500@comp.chem.msu.su> <20060219225701.0e3e244b.rosti.bsd@gmail.com> <20060221165959.GB77513@comp.chem.msu.su> <20060222024430.ad4b5c60.rosti.bsd@gmail.com> <20060223235727.33cddb13.rosti.bsd@gmail.com> <20060224155153.f7da1a52.rosti.bsd@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i Cc: freebsd-stable@freebsd.org, freebsd-stable-local@be-well.ilk.org, dwmalone@maths.tcd.ie, Rostislav Krasny , des@des.no, mak@ll.mit.edu, MH@kernel32.de Subject: Re: SSH login takes very long time...sometimes X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2006 15:20:36 -0000 On Sat, Feb 25, 2006 at 02:08:21AM +0900, Hajimu UMEMOTO wrote: > >>>>> On Fri, 24 Feb 2006 15:51:53 +0200 > >>>>> Rostislav Krasny said: > > rosti> Excellent! What about RES_DFLRETRY decreasing from 4 to 2? Does it need > rosti> more testing or discussion? > > It seems reasonable to me, and there are no objection here. So, I've > just committed both into HEAD. I finally spared some time to test your recent changes and found that the resolver still would retry using the first, and only the first, domain on the `search' list when the nameserver was down, which effectively led to another kind of request doubling. A similar effect was observed when a `domain' line was specified in resolv.conf in place of `search'. Is there a real reason to retry with a different domain when the nameserver doesn't respond at all? -- Yar P.S. Here's the details of what I'm talking about: Commands: vpc7# hostname vpc7 vpc7# cat /etc/resolv.conf search aaa.ru bbb.ru nameserver 195.208.208.25 vpc7# ./gethost foo foo: Host name lookup failure vpc7# ./gethost foo.zzz.ru foo.zzz.ru: Host name lookup failure tcpdump: === for ./gethost foo === 18:01:51.756764 IP 10.1.1.27.51030 > 195.208.208.25.53: 5443+ A? foo.aaa.ru. (33) 18:01:56.971187 IP 10.1.1.27.57913 > 195.208.208.25.53: 5443+ A? foo.aaa.ru. (33) 18:02:07.071088 IP 10.1.1.27.55508 > 195.208.208.25.53: 5444+ A? foo. (21) 18:02:12.210384 IP 10.1.1.27.62824 > 195.208.208.25.53: 5444+ A? foo. (21) === for ./gethost foo.zzz.ru === 18:02:33.509361 IP 10.1.1.27.65031 > 195.208.208.25.53: 19867+ A? foo.zzz.ru. (32) 18:02:38.567045 IP 10.1.1.27.55358 > 195.208.208.25.53: 19867+ A? foo.zzz.ru. (32) 18:02:48.824136 IP 10.1.1.27.61855 > 195.208.208.25.53: 19868+ A? foo.zzz.ru.aaa.ru. (44) 18:02:53.922071 IP 10.1.1.27.49351 > 195.208.208.25.53: 19868+ A? foo.zzz.ru.aaa.ru. (44) Here's ./gethost src. It essentially calls a single gethostbyname() if given a host name or gethostbyaddr() if given an IP address. === gethost.c === #include #include #include #include #include #include int main(int argc, char **argv) { struct in_addr ia; struct hostent *hp; char *name; char **st; if (argc < 2) return (2); name = argv[1]; if (inet_aton(name, &ia)) hp = gethostbyaddr((char *)&ia, sizeof(ia), AF_INET); else hp = gethostbyname(name); if (hp == NULL) { herror(name); return (1); } printf("%s\n", hp->h_name); for (st = hp->h_addr_list; *st; st++) printf("%s\n", inet_ntoa(*(struct in_addr *)*st)); if (st == hp->h_addr_list) printf("no address records\n"); return (0); }