From cdc050a3204d46f15d176c65717bf6fa9debb088 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Tue, 29 Mar 2016 05:32:32 +0200 Subject: Query whois.iana.org for IDN TLDs too --- whois.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'whois.c') diff --git a/whois.c b/whois.c index 7262bea..7f01582 100644 --- a/whois.c +++ b/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))); -- cgit v1.2.3