summaryrefslogtreecommitdiffstats
path: root/usr.bin/whois/whois.c
diff options
context:
space:
mode:
authorfanf <fanf@FreeBSD.org>2015-05-14 11:37:36 +0000
committerfanf <fanf@FreeBSD.org>2015-05-14 11:37:36 +0000
commit2f34b1414eb88c8e61d9920831feab23f1075672 (patch)
treeceae83fd1c0fade611ca87ec40525e8af9afa6e3 /usr.bin/whois/whois.c
parent468f92a106df831786217c2f0af90985088f56fb (diff)
downloadFreeBSD-src-2f34b1414eb88c8e61d9920831feab23f1075672.zip
FreeBSD-src-2f34b1414eb88c8e61d9920831feab23f1075672.tar.gz
whois: add an option to query the PeeringDB
Diffstat (limited to 'usr.bin/whois/whois.c')
-rw-r--r--usr.bin/whois/whois.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c
index 87e48d5..6ad8826 100644
--- a/usr.bin/whois/whois.c
+++ b/usr.bin/whois/whois.c
@@ -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);
}
OpenPOWER on IntegriCloud