summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-11-15 01:46:42 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-11-15 01:46:42 +0000
commit65219ec51c58debd241fe9fd0c7e8b9ff61a0b89 (patch)
tree38df4122bc287f54a5460e64e9080baefdc5adc7
parent695565d5f8985d6007b6cc58fc4162aefe771e3c (diff)
From FreeBSD:
o Change default nic host to whois.crsnic.net to also get hosts registered by registrars other than NSI. o -i option to use NSI's nic host (whois.internic.net) o -g option to use .gov nic host o -R option to use .ru nic host
-rw-r--r--usr.bin/whois/whois.127
-rw-r--r--usr.bin/whois/whois.c32
2 files changed, 46 insertions, 13 deletions
diff --git a/usr.bin/whois/whois.1 b/usr.bin/whois/whois.1
index 9afe84ef4ea..9700d2a4e3c 100644
--- a/usr.bin/whois/whois.1
+++ b/usr.bin/whois/whois.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: whois.1,v 1.7 1999/10/04 16:44:09 deraadt Exp $
+.\" $OpenBSD: whois.1,v 1.8 1999/11/15 01:46:41 millert Exp $
.\" $NetBSD: whois.1,v 1.5 1995/08/31 21:51:32 jtc Exp $
.\"
.\" Copyright (c) 1985, 1990, 1993
@@ -42,7 +42,7 @@
.Nd Internet domain name and network number directory service
.Sh SYNOPSIS
.Nm whois
-.Op Fl adpr
+.Op Fl adgiprR
.Op Fl h Ar host
.Ar name Op Ar ...
.Sh DESCRIPTION
@@ -65,10 +65,25 @@ Use the (US Military) Defense Data Network
.Pq Tn DDN
database. It contains points of contact for subdomains of
.Tn \&.MIL Ns .
+.It Fl g
+Use the US non-military federal government database, which contains points of
+contact for subdomains of
+.Tn \&.GOV Ns .
.It Fl h Ar host
Use the specified host instead of the default NIC
-(whois.internic.net).
+(whois.crsnic.net).
Either a host name or an IP address may be specified.
+.It Fl i
+Use the Network Solutions Registry for Internet Numbers
+.Pq Tn InterNIC
+database. It contains network numbers and domain contact information
+for most of
+.Tn \&.COM ,
+.Tn \&.NET ,
+.Tn \&.ORG
+and
+.Tn \&.EDU
+domains.
.It Fl m
Use the Route Arbiter Database
.Pq Tn RADB
@@ -100,6 +115,12 @@ Use the R\(aaeseaux IP Europ\(aaeens
.Pq Tn RIPE
database. It contains network numbers and domain contact information
for Europe.
+.It Fl R
+Use the Russia Network Information Center
+.Pq Tn RIPN
+database. It contains network numbers and domain contact information
+for subdomains of
+.Tn \&.RU Ns .
.El
.Pp
The operands specified to
diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c
index fad5f9e58ca..8d4ed3d3ceb 100644
--- a/usr.bin/whois/whois.c
+++ b/usr.bin/whois/whois.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: whois.c,v 1.6 1999/10/03 00:42:34 deraadt Exp $ */
+/* $OpenBSD: whois.c,v 1.7 1999/11/15 01:46:41 millert Exp $ */
/* $NetBSD: whois.c,v 1.5 1994/11/14 05:13:25 jtc Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)whois.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: whois.c,v 1.6 1999/10/03 00:42:34 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: whois.c,v 1.7 1999/11/15 01:46:41 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -52,31 +52,32 @@ static char rcsid[] = "$OpenBSD: whois.c,v 1.6 1999/10/03 00:42:34 deraadt Exp $
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
+#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sysexits.h>
#include <unistd.h>
-#include <err.h>
-#define NICHOST "whois.internic.net"
-#define DNICHOST "nic.ddn.mil"
+#define NICHOST "whois.crsnic.net"
+#define INICHOST "whois.internic.net"
+#define DNICHOST "whois.nic.mil"
+#define GNICHOST "whois.nic.gov"
#define ANICHOST "whois.arin.net"
#define RNICHOST "whois.ripe.net"
#define PNICHOST "whois.apnic.net"
+#define RUNICHOST "whois.ripn.net"
#define MNICHOST "whois.ra.net"
#define QNICHOST_TAIL ".whois-servers.net"
#define WHOIS_PORT 43
-static void usage();
+static void usage __P((void));
int
main(argc, argv)
int argc;
char **argv;
{
- extern char *optarg;
- extern int optind;
register FILE *sfi, *sfo;
register int ch;
struct sockaddr_in sin;
@@ -90,7 +91,7 @@ main(argc, argv)
host = NICHOST;
use_qnichost = 0;
- while ((ch = getopt(argc, argv, "adh:pmqr")) != -1)
+ while ((ch = getopt(argc, argv, "adgh:impqrR")) != -1)
switch((char)ch) {
case 'a':
host = ANICHOST;
@@ -98,9 +99,15 @@ main(argc, argv)
case 'd':
host = DNICHOST;
break;
+ case 'g':
+ host = GNICHOST;
+ break;
case 'h':
host = optarg;
break;
+ case 'i':
+ host = INICHOST;
+ break;
case 'm':
host = MNICHOST;
break;
@@ -113,6 +120,9 @@ main(argc, argv)
case 'r':
host = RNICHOST;
break;
+ case 'R':
+ host = RUNICHOST;
+ break;
case '?':
default:
usage();
@@ -180,6 +190,8 @@ main(argc, argv)
static void
usage()
{
- (void)fprintf(stderr, "usage: whois [-admpqr] [-h hostname] name ...\n");
+
+ (void)fprintf(stderr,
+ "usage: whois [-adgimpqrR] [-h hostname] name ...\n");
exit(EX_USAGE);
}