diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c index 49b20057722b..9bae3b1cabd4 100644 --- a/usr.bin/whois/whois.c +++ b/usr.bin/whois/whois.c @@ -114,9 +114,16 @@ static struct { WHOIS_REFERRAL("Whois Server:"), WHOIS_REFERRAL("Registrar WHOIS Server:"), /* corporatedomains.com */ WHOIS_REFERRAL("ReferralServer: whois://"), /* ARIN */ + WHOIS_REFERRAL("descr: region. Please query"), /* AfriNIC */ { NULL, 0 } }; +static const char *actually_arin[] = { + "netname: ERX-NETBLOCK\n", /* APNIC */ + "netname: NON-RIPE-NCC-MANAGED-ADDRESS-BLOCK\n", + NULL +}; + static const char *port = DEFAULT_PORT; static const char *choose_server(char *); @@ -469,6 +476,12 @@ whois(const char *query, const char *hostname, int flags) (int)(p - host), host); break; } + for (i = 0; actually_arin[i] != NULL; i++) { + if (strncmp(buf, actually_arin[i], len) == 0) { + s_asprintf(&nhost, "%s", ANICHOST); + break; + } + } } /* Verisign etc. */ if (!(flags & WHOIS_SPAM_ME) &&