mirror of
https://github.com/rfc1036/whois.git
synced 2026-05-03 06:51:09 +00:00
Ask whois.iana.org about TLDs
Recognize as a TLD any string without dots present in tld_serv_list and new_gtlds_list.
This commit is contained in:
parent
4cc74ef22a
commit
8ccab2cb13
9
whois.c
9
whois.c
@ -496,6 +496,15 @@ char *guess_server(const char *s)
|
||||
|
||||
/* no dot and no hyphen means it's a NSI NIC handle or ASN (?) */
|
||||
if (!strpbrk(s, ".-")) {
|
||||
/* if it is a TLD or a new gTLD then ask IANA */
|
||||
for (i = 0; tld_serv[i]; i += 2)
|
||||
if (strcaseeq(s, tld_serv[i]))
|
||||
return strdup("whois.iana.org");
|
||||
|
||||
for (i = 0; new_gtlds[i]; i++)
|
||||
if (strcaseeq(s, new_gtlds[i]))
|
||||
return strdup("whois.iana.org");
|
||||
|
||||
if (strncaseeq(s, "as", 2) && /* it's an AS */
|
||||
(isasciidigit(s[2]) || s[2] == ' '))
|
||||
return strdup(whereas(atol(s + 2)));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user