-.\" $OpenBSD: whois.1,v 1.40 2024/03/16 02:00:31 millert Exp $
+.\" $OpenBSD: whois.1,v 1.41 2024/03/24 19:51:47 millert Exp $
.\" $NetBSD: whois.1,v 1.5 1995/08/31 21:51:32 jtc Exp $
.\"
.\" Copyright (c) 1985, 1990, 1993
.\"
.\" @(#)whois.1 8.2 (Berkeley) 6/20/94
.\"
-.Dd $Mdocdate: March 16 2024 $
+.Dd $Mdocdate: March 24 2024 $
.Dt WHOIS 1
.Os
.Sh NAME
operands have special meaning, and how to guide the search, use
the special name
.Dq help .
-.Ss Special cases
-Queries beginning with an exclamation point
-.Ql \&!
-are assumed to be
-.Tn NSI
-contact handles.
-Unless a host or domain is specified on the command line,
-.Pq whois.networksolutions.com
-will be used as the
-.Nm
-database.
-.Pp
-Similarly, queries beginning with
-.Dq COCO-
-are assumed to be
-.Tn CORE
-contact handles.
-Unless a host or domain is specified on the command line,
-.Pq whois.corenic.net
-will be used as the
-.Nm
-database.
.Sh EXAMPLES
Most types of data, such as domain names and
.Tn IP
-/* $OpenBSD: whois.c,v 1.61 2024/03/16 06:29:36 jmc Exp $ */
+/* $OpenBSD: whois.c,v 1.62 2024/03/24 19:51:47 millert Exp $ */
/*
* Copyright (c) 1980, 1993
#define NICHOST "whois.crsnic.net"
#define INICHOST "whois.internic.net"
-#define CNICHOST "whois.corenic.net"
#define DNICHOST "whois.nic.mil"
#define GNICHOST "whois.nic.gov"
#define ANICHOST "whois.arin.net"
/*
* If no country is specified determine the top level domain from the query.
* If the TLD is a number, query ARIN, otherwise, use TLD.whois-server.net.
- * If the domain does not contain '.', check to see if it is an NSI handle
- * (starts with '!') or a CORE handle (COCO-[0-9]+ or COHO-[0-9]+) or an
- * ASN (starts with AS) or IPv6 address (contains ':'). Fall back to
- * NICHOST for the non-handle and non-IPv6 case.
+ * If the domain does not contain '.', check to see if it is an ASN (starts
+ * with AS) or IPv6 address (contains ':').
+ * Fall back to NICHOST for the non-handle and non-IPv6 case.
*/
char *
choose_server(const char *name, const char *country, char **tofree)
if (country != NULL)
qhead = country;
else if ((qhead = strrchr(name, '.')) == NULL) {
- if (*name == '!')
- return (INICHOST);
- else if ((strncasecmp(name, "COCO-", 5) == 0 ||
- strncasecmp(name, "COHO-", 5) == 0) &&
- strtol(name + 5, &ep, 10) > 0 && *ep == '\0')
- return (CNICHOST);
- else if ((strncasecmp(name, "AS", 2) == 0) &&
+ if ((strncasecmp(name, "AS", 2) == 0) &&
strtol(name + 2, &ep, 10) > 0 && *ep == '\0')
return (MNICHOST);
else if (strchr(name, ':') != NULL) /* IPv6 address */