whois: add an option to query the PeeringDB
This commit is contained in:
parent
468f92a106
commit
2f34b1414e
@ -159,6 +159,10 @@ Connect to the whois server on
|
||||
If this option is not specified,
|
||||
.Nm
|
||||
defaults to port 43.
|
||||
.It Fl P
|
||||
Use the PeeringDB database of AS numbers.
|
||||
It contains details about presence at internet peering points
|
||||
for many network operators.
|
||||
.It Fl Q
|
||||
Do a quick lookup.
|
||||
This means that
|
||||
|
@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$");
|
||||
#define LNICHOST "whois.lacnic.net"
|
||||
#define MNICHOST "whois.ra.net"
|
||||
#define NICHOST "whois.crsnic.net"
|
||||
#define PDBHOST "whois.peeringdb.com"
|
||||
#define PNICHOST "whois.apnic.net"
|
||||
#define QNICHOST_HEAD "whois.nic."
|
||||
#define QNICHOST_TAIL ".whois-servers.net"
|
||||
@ -122,7 +123,7 @@ main(int argc, char *argv[])
|
||||
|
||||
country = host = qnichost = NULL;
|
||||
flags = use_qnichost = 0;
|
||||
while ((ch = getopt(argc, argv, "aAbc:fgh:iIklmp:Qr")) != -1) {
|
||||
while ((ch = getopt(argc, argv, "aAbc:fgh:iIklmp:PQr")) != -1) {
|
||||
switch (ch) {
|
||||
case 'a':
|
||||
host = ANICHOST;
|
||||
@ -163,6 +164,9 @@ main(int argc, char *argv[])
|
||||
case 'p':
|
||||
port = optarg;
|
||||
break;
|
||||
case 'P':
|
||||
host = PDBHOST;
|
||||
break;
|
||||
case 'Q':
|
||||
flags |= WHOIS_QUICK;
|
||||
break;
|
||||
@ -511,7 +515,7 @@ static void
|
||||
usage(void)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"usage: whois [-aAbfgiIklmQr] [-c country-code | -h hostname] "
|
||||
"usage: whois [-aAbfgiIklmPQr] [-c country-code | -h hostname] "
|
||||
"[-p port] name ...\n");
|
||||
exit(EX_USAGE);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user