Date: Thu, 24 Oct 2002 19:16:53 -0700 (PDT) From: David Wolfskill <david@catwhisker.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/44448: Add support for whois to automagically query whois.lacnic.net Message-ID: <200210250216.g9P2Grxb015567@bunrab.catwhisker.org>
next in thread | raw e-mail | index | archive | help
>Number: 44448
>Category: bin
>Synopsis: Add support for whois to automagically query whois.lacnic.net
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Thu Oct 24 19:20:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: David Wolfskill
>Release: FreeBSD 4.7-STABLE i386
>Organization:
Wolfskill & Dowling residence
>Environment:
System: FreeBSD bunrab.catwhisker.org 4.7-STABLE FreeBSD 4.7-STABLE #26: Sun Oct 20 07:49:39 PDT 2002 root@freebeast.catwhisker.org:/common/S1/obj/usr/src/sys/BUNRAB i386
Since the -STABLE and -CURRENT sources for whois are presently
in sync, this ought to be OK on -CURRENT, too. (And I just
tested same on:
freebeast(5.0-C)[22] uname -a
FreeBSD freebeast.catwhisker.org 5.0-CURRENT FreeBSD 5.0-CURRENT #33: Thu Oct 24 07:17:02 PDT 2002 root@freebeast.catwhisker.org:/common/S4/obj/usr/src/sys/FREEBEAST i386
freebeast(5.0-C)[23]
. Yes, it worked as described.)
>Description:
Just as one actually queries whois.ripe.net to determine
delegation of European netblocks, there is now a Latin American
WHOIS server, whois.lacnic.net.
The supplied patch adds support to query whois.lacnic.net, both
automagically, and via (explicit) -l flag.
>How-To-Repeat:
whois 200.34.123.2 # as a quasi-random IP address that I
# figured would be under LACNIC's ovesight.
Note that what you see is a referral to LACNIC.
Then apply the below patches; re-make whois, and try again.
This time, you see that the 200.34.112/20 CIDR block has
been reassigned to CITI, of Monterrey, Nuevo Leon, Mexico.
I took a stab at updating the man page, too.
>Fix:
Index: whois.1
===================================================================
RCS file: /cvs/freebsd/src/usr.bin/whois/whois.1,v
retrieving revision 1.27
diff -u -r1.27 whois.1
--- whois.1 20 Apr 2002 12:18:02 -0000 1.27
+++ whois.1 25 Oct 2002 02:02:10 -0000
@@ -108,7 +108,8 @@
If a query to
.Tn ARIN
references
-.Tn APNIC
+.Tn APNIC ,
+.Tn LACNIC ,
or
.Tn RIPE ,
that server will be queried also, provided that the
@@ -149,6 +150,12 @@
.Tn NIC
handle in the query.)
.Pp
+.It Fl l
+Use the Latin American and Caribbean IP address Regional Registry
+.Pq Tn LACNIC
+database.
+It contains network numbers used in much of Latin America and the
+Caribbean.
.It Fl m
Use the Route Arbiter Database
.Pq Tn RADB
Index: whois.c
===================================================================
RCS file: /cvs/freebsd/src/usr.bin/whois/whois.c,v
retrieving revision 1.31
diff -u -r1.31 whois.c
--- whois.c 18 Sep 2002 07:51:46 -0000 1.31
+++ whois.c 25 Oct 2002 02:13:33 -0000
@@ -65,6 +65,7 @@
#define DNICHOST "whois.nic.mil"
#define GNICHOST "whois.nic.gov"
#define ANICHOST "whois.arin.net"
+#define LNICHOST "whois.lacnic.net"
#define RNICHOST "whois.ripe.net"
#define PNICHOST "whois.apnic.net"
#define MNICHOST "whois.ra.net"
@@ -79,7 +80,7 @@
#define ishost(h) (isalnum((unsigned char)h) || h == '.' || h == '-')
-const char *ip_whois[] = { RNICHOST, PNICHOST, BNICHOST, NULL };
+const char *ip_whois[] = { LNICHOST, RNICHOST, PNICHOST, BNICHOST, NULL };
const char *port = DEFAULT_PORT;
static char *choose_server(char *);
@@ -101,7 +102,7 @@
country = host = qnichost = NULL;
flags = use_qnichost = 0;
- while ((ch = getopt(argc, argv, "aAc:dgh:imp:QrR6")) != -1) {
+ while ((ch = getopt(argc, argv, "aAc:dgh:ilmp:QrR6")) != -1) {
switch (ch) {
case 'a':
host = ANICHOST;
@@ -123,6 +124,9 @@
break;
case 'i':
host = INICHOST;
+ break;
+ case 'l':
+ host = LNICHOST;
break;
case 'm':
host = MNICHOST;
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210250216.g9P2Grxb015567>
