Direct queries for IP numbers to ARIN. It would be nice if we could
send them to APNIC/RIPE intelligently, but we can't at this time so fallback to ARIN and depend on them telling the user where to look. Maybe we need a .whoisrc file... PR: 24707 Submitted by: Mike Barcroft mike@q9media.com MFC after: 1 week
This commit is contained in:
parent
a4e805e466
commit
55c4fe024f
@ -86,6 +86,12 @@ of the supplied (single) argument, and appending
|
|||||||
.Qq Li .whois-servers.net .
|
.Qq Li .whois-servers.net .
|
||||||
This effectively allows a suitable whois server to be selected
|
This effectively allows a suitable whois server to be selected
|
||||||
automatically for a large number of TLDs.
|
automatically for a large number of TLDs.
|
||||||
|
.Pp
|
||||||
|
In the event that an IP
|
||||||
|
address is specified, the whois server will default to the American
|
||||||
|
Registry for Internet Numbers
|
||||||
|
.Pq Tn ARIN .
|
||||||
|
.Pp
|
||||||
If no required
|
If no required
|
||||||
.Pa whois-servers.net
|
.Pa whois-servers.net
|
||||||
subdomain found, fallback to
|
subdomain found, fallback to
|
||||||
|
@ -49,6 +49,7 @@ static const char rcsid[] =
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
#include <ctype.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -166,13 +167,19 @@ main(argc, argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (j != 0) {
|
if (j != 0) {
|
||||||
qnichost = (char *) calloc(i - j + 1 +
|
if (isdigit(*(*argv + j + 1))) {
|
||||||
strlen(QNICHOST_TAIL), sizeof(char));
|
(void) asprintf(&qnichost, "%s",
|
||||||
if (!qnichost) {
|
ANICHOST);
|
||||||
err(1, "calloc");
|
} else {
|
||||||
|
qnichost = (char *) calloc(i - j
|
||||||
|
+ 1 + strlen(QNICHOST_TAIL),
|
||||||
|
sizeof(char));
|
||||||
|
if (!qnichost) {
|
||||||
|
err(1, "calloc");
|
||||||
|
}
|
||||||
|
strcpy(qnichost, *argv + j + 1);
|
||||||
|
strcat(qnichost, QNICHOST_TAIL);
|
||||||
}
|
}
|
||||||
strcpy(qnichost, *argv + j + 1);
|
|
||||||
strcat(qnichost, QNICHOST_TAIL);
|
|
||||||
|
|
||||||
memset(&hints, 0, sizeof(hints));
|
memset(&hints, 0, sizeof(hints));
|
||||||
hints.ai_flags = 0;
|
hints.ai_flags = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user