From owner-freebsd-bugs@FreeBSD.ORG Sun Nov 9 16:00:10 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE274106567E for ; Sun, 9 Nov 2008 16:00:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A6FCB8FC1A for ; Sun, 9 Nov 2008 16:00:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id mA9G0AW2034770 for ; Sun, 9 Nov 2008 16:00:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id mA9G0AcJ034769; Sun, 9 Nov 2008 16:00:10 GMT (envelope-from gnats) Resent-Date: Sun, 9 Nov 2008 16:00:10 GMT Resent-Message-Id: <200811091600.mA9G0AcJ034769@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Matt D. Harris" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52B751065670 for ; Sun, 9 Nov 2008 15:53:07 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 3CF518FC13 for ; Sun, 9 Nov 2008 15:53:07 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id mA9Fr6pI011816 for ; Sun, 9 Nov 2008 15:53:07 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id mA9Fr6Tu011815; Sun, 9 Nov 2008 15:53:06 GMT (envelope-from nobody) Message-Id: <200811091553.mA9Fr6Tu011815@www.freebsd.org> Date: Sun, 9 Nov 2008 15:53:06 GMT From: "Matt D. Harris" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/128725: whois(1) does not correctly send queries regarding IPv6 addresses to the RIR whois servers X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 16:00:10 -0000 >Number: 128725 >Category: bin >Synopsis: whois(1) does not correctly send queries regarding IPv6 addresses to the RIR whois servers >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Nov 09 16:00:09 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Matt D. Harris >Release: RELENG_7_0 >Organization: >Environment: FreeBSD rapier.mydomain 7.0-RELEASE-p5 FreeBSD 7.0-RELEASE-p5 #0: Thu Nov 6 14:39:04 PST 2008 root@rapier.mydomain:/usr/src/sys/i386/compile/RAPIER i386 >Description: An example: (root@rapier) [/usr/local/etc]: whois 2001:960:800::2 Whois Server Version 2.0 Domain names in the .com and .net domains can now be registered with many different competing registrars. Go to http://www.internic.net for detailed information. No match for "2001:960:800::2". >How-To-Repeat: Run whois(1) on a given IPv6 address without using a command line option to specify the whois server address to utilize for query resolution. >Fix: I've attached a patch which replicates the behavior which is exhibited for IPv4 - which is that ARIN is queried. This results in ARIN saying it doesn't know about RIPE, etc records, however the same behavior exists when querying an IPv4 address. My personal feeling is that replicating the behavior exhibited for IPv4 is superior to doing something wholly different, even if it isn't perfect. In this case, I don't know if perfection is achievable. Until ARIN replicates the behavior which is exhibited for IPv4 in their whois server regarding RIPE, APNIC, and other RIR data, this is likely the best we can do. Patch attached with submission follows: --- whois.c 2008-11-09 10:48:41.000000000 -0500 +++ /usr/src/usr.bin/whois/whois.c 2007-04-14 10:32:48.000000000 -0400 @@ -218,11 +218,6 @@ { char *pos, *retval; - if (strchr(domain, ':')) - { - s_asprintf(&retval, "%s", ANICHOST); - return (retval); - } for (pos = strchr(domain, '\0'); pos > domain && *--pos == '.';) *pos = '\0'; if (*domain == '\0') >Release-Note: >Audit-Trail: >Unformatted: >>> Last update of whois database: Sun, 09 Nov 2008 10:14:51 EST <<< For IPv4 addresses, the correct RIR whois server is automagically queried. For CC-TLD domain names, the same is true. Unfortunately, IPv6 queries seem to go to a domain name whois server.