From james@now.ie  Tue Mar  4 04:04:09 2003
Return-Path: <james@now.ie>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9FE1037B401
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  4 Mar 2003 04:04:09 -0800 (PST)
Received: from worf.kerna.com (worf.kerna.com [194.106.143.118])
	by mx1.FreeBSD.org (Postfix) with SMTP id 3902243FD7
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  4 Mar 2003 04:04:06 -0800 (PST)
	(envelope-from james@now.ie)
Received: (qmail 92060 invoked by uid 1001); 4 Mar 2003 12:04:03 -0000
Message-Id: <20030304120403.92059.qmail@bender.kerna.ie>
Date: 4 Mar 2003 12:04:03 -0000
From: James Raftery <james@now.ie>
Reply-To: James Raftery <james@now.ie>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] Add flag to whois(1) to query IANA TLD WHOIS server
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         48914
>Category:       bin
>Synopsis:       [PATCH] Add flag to whois(1) to query IANA TLD WHOIS server
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bms
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 04 04:10:06 PST 2003
>Closed-Date:    Sun Dec 12 23:16:19 GMT 2004
>Last-Modified:  Sun Dec 12 23:16:19 GMT 2004
>Originator:     James Raftery
>Release:        FreeBSD 4.7-RELEASE-p3 i386
>Organization:
>Environment:
System: FreeBSD bender.kerna.ie 4.7-RELEASE-p3 FreeBSD 4.7-RELEASE-p3 #6: Thu Jan 9 14:06:32 GMT 2003 root@bender.kerna.ie:/usr/obj/usr/src/sys/BENDER i386

>Description:
	Patch to add a -I flag to whois(1) to query the IANA TLD
	WHOIS server, whois.iana.org. All TLD info. has been moved out
	of the NetSol and InterNIC WHOIS services.

>How-To-Repeat:
	N/A

>Fix:
	Patch below adds a -I flag. 'whois -I ie' will query
	whois.iana.org for 'ie' and show the results.


diff -ruN usr.bin/whois.orig/whois.1 usr.bin/whois/whois.1
--- usr.bin/whois.orig/whois.1	Tue Mar  4 11:46:57 2003
+++ usr.bin/whois/whois.1	Tue Mar  4 11:53:18 2003
@@ -40,7 +40,7 @@
 .Nd "Internet domain name and network number directory service"
 .Sh SYNOPSIS
 .Nm
-.Op Fl adgimpQrR6
+.Op Fl adgiImpQrR6
 .Op Fl c Ar country-code | Fl h Ar host
 .Ar name ...
 .Sh DESCRIPTION
@@ -142,6 +142,11 @@
 .Tn NIC
 handle in the query.)
 .Pp
+.It Fl I
+Use the Internet Assigned Numbers Authority
+.Pq Tn IANA
+database.
+It contains network information for top-level domains.
 .It Fl m
 Use the Route Arbiter Database
 .Pq Tn RADB
diff -ruN usr.bin/whois.orig/whois.c usr.bin/whois/whois.c
--- usr.bin/whois.orig/whois.c	Tue Mar  4 11:47:16 2003
+++ usr.bin/whois/whois.c	Tue Mar  4 11:53:18 2003
@@ -64,6 +64,7 @@
 #define	INICHOST	"whois.networksolutions.com"
 #define	DNICHOST	"whois.nic.mil"
 #define	GNICHOST	"whois.nic.gov"
+#define	IANAHOST	"whois.iana.org"
 #define	ANICHOST	"whois.arin.net"
 #define	RNICHOST	"whois.ripe.net"
 #define	PNICHOST	"whois.apnic.net"
@@ -100,7 +101,7 @@
 
 	country = host = qnichost = NULL;
 	flags = use_qnichost = 0;
-	while ((ch = getopt(argc, argv, "ac:dgh:impQrR6")) != -1) {
+	while ((ch = getopt(argc, argv, "ac:dgh:iImpQrR6")) != -1) {
 		switch (ch) {
 		case 'a':
 			host = ANICHOST;
@@ -120,6 +121,9 @@
 		case 'i':
 			host = INICHOST;
 			break;
+		case 'I':
+			host = IANAHOST;
+			break;
 		case 'm':
 			host = MNICHOST;
 			break;
@@ -310,7 +314,7 @@
 usage(void)
 {
 	fprintf(stderr,
-	    "usage: whois [-adgimpQrR6] [-c country-code | -h hostname] "
+	    "usage: whois [-adgiImpQrR6] [-c country-code | -h hostname] "
 	    "name ...\n");
 	exit(EX_USAGE);
 }
>Release-Note:
>Audit-Trail:

From: Lyndon Nerenberg <lyndon@orthanc.ab.ca>
To: James Raftery <james@now.ie>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/48914: [PATCH] Add flag to whois(1) to query IANA TLD WHOIS server 
Date: Tue, 04 Mar 2003 09:44:41 -0700

 >	Patch below adds a -I flag. 'whois -I ie' will query
 >	whois.iana.org for 'ie' and show the results.
 
 Instead of adding a flag, wouldn't it be more intuitive if whois
 automatically queried IANA when presented with a single-level
 domain component? That is, if the host argument contains zero
 '.' characters, or a single '.' at the end of the host argument,
 assume it's a TLD and query the IANA server?

From: James Raftery <james@now.ie>
To: Lyndon Nerenberg <lyndon@orthanc.ab.ca>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/48914: [PATCH] Add flag to whois(1) to query IANA TLD WHOIS server
Date: Wed, 5 Mar 2003 17:21:20 +0000

 Lyndon Nerenberg <lyndon@orthanc.ab.ca> wrote:
 > Instead of adding a flag, wouldn't it be more intuitive if whois
 > automatically queried IANA when presented with a single-level
 > domain component? That is, if the host argument contains zero
 > '.' characters,
 
 I had considered that, but that risks violation of POLA. I didn't
 want to change the bahaviour of 'whois foo', for any value of 'foo'.
 
 > or a single '.' at the end of the host argument,
 > assume it's a TLD and query the IANA server?
 
 That might be useful too.
 
 
 ATB,
 james

From: Ceri Davies <setantae@submonkey.net>
To: James Raftery <james@now.ie>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/48914: [PATCH] Add flag to whois(1) to query IANA TLD WHOIS server
Date: Thu, 6 Mar 2003 23:06:39 +0000

 On Wed, Mar 05, 2003 at 09:30:07AM -0800, James Raftery wrote:
 > The following reply was made to PR bin/48914; it has been noted by GNATS.
 > 
 > From: James Raftery <james@now.ie>
 > To: Lyndon Nerenberg <lyndon@orthanc.ab.ca>
 > Cc: FreeBSD-gnats-submit@FreeBSD.ORG
 > Subject: Re: bin/48914: [PATCH] Add flag to whois(1) to query IANA TLD WHOIS server
 > Date: Wed, 5 Mar 2003 17:21:20 +0000
 > 
 >  Lyndon Nerenberg <lyndon@orthanc.ab.ca> wrote:
 >  > Instead of adding a flag, wouldn't it be more intuitive if whois
 >  > automatically queried IANA when presented with a single-level
 >  > domain component? That is, if the host argument contains zero
 >  > '.' characters,
 >  
 >  I had considered that, but that risks violation of POLA. I didn't
 >  want to change the bahaviour of 'whois foo', for any value of 'foo'.
 >  
 >  > or a single '.' at the end of the host argument,
 >  > assume it's a TLD and query the IANA server?
 >  
 >  That might be useful too.
 
 There's always ${tld}.whois-servers.net ; this works in every case I've
 tried.
 
 Ceri
 -- 

From: James Raftery <james@now.ie>
To: Ceri Davies <setantae@submonkey.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/48914: [PATCH] Add flag to whois(1) to query IANA TLD WHOIS server
Date: Fri, 7 Mar 2003 16:03:52 +0000

 Ceri Davies <setantae@submonkey.net> wrote:
 > There's always ${tld}.whois-servers.net ; this works in every case I've
 > tried.
 
 whois(1) already uses that service. That's how, for example,
 'whois denic.de' works.
 
 However, the WHOIS server at de.whois-servers.net cannot tell you
 about 'de', only '<something>.de'. The WHOIS server that knows about
 top-levels domains themselves (ie, uk, de, com, int, ...) is
 whois.iana.org.
 
 
 Regards,
 james
Responsible-Changed-From-To: freebsd-bugs->mike 
Responsible-Changed-By: mike 
Responsible-Changed-When: Mon Mar 17 11:39:20 PST 2003 
Responsible-Changed-Why:  
Over to me. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=48914 
Responsible-Changed-From-To: mike->bms 
Responsible-Changed-By: bms 
Responsible-Changed-When: Mon Jun 14 14:02:08 GMT 2004 
Responsible-Changed-Why:  
I'll take this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=48914 
State-Changed-From-To: open->patched 
State-Changed-By: bms 
State-Changed-When: Mon Jun 14 14:03:12 GMT 2004 
State-Changed-Why:  
Committed to HEAD 

http://www.freebsd.org/cgi/query-pr.cgi?pr=48914 
State-Changed-From-To: patched->closed 
State-Changed-By: marius 
State-Changed-When: Sun Dec 12 23:14:28 GMT 2004 
State-Changed-Why:  

MFC'ed to RELENG_4. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=48914 
>Unformatted:
