mirror of
https://github.com/rfc1036/whois.git
synced 2026-04-03 06:40:52 +00:00
Query whois.iana.org for IDN TLDs too
This commit is contained in:
parent
5287536ec7
commit
cdc050a320
6
whois.c
6
whois.c
@ -511,8 +511,7 @@ char *guess_server(const char *s)
|
||||
if (strchr(s, '@'))
|
||||
return strdup("\x05");
|
||||
|
||||
/* no dot and no hyphen means it's a NSI NIC handle or ASN (?) */
|
||||
if (!strpbrk(s, ".-")) {
|
||||
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]))
|
||||
@ -521,7 +520,10 @@ char *guess_server(const char *s)
|
||||
for (i = 0; new_gtlds[i]; i++)
|
||||
if (strcaseeq(s, new_gtlds[i]))
|
||||
return strdup("whois.iana.org");
|
||||
}
|
||||
|
||||
/* no dot and no hyphen means it's a NSI NIC handle or ASN (?) */
|
||||
if (!strpbrk(s, ".-")) {
|
||||
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