diff options
author | Marco d'Itri <md@linux.it> | 2016-03-29 05:32:32 +0200 |
---|---|---|
committer | Marco d'Itri <md@linux.it> | 2016-03-29 05:32:32 +0200 |
commit | cdc050a3204d46f15d176c65717bf6fa9debb088 (patch) | |
tree | be76493ae476cb2c523aa40c80cc73f3b615ef85 /whois.c | |
parent | 5287536ec79f08c61c41e33852c1f4d8c3e5991a (diff) | |
download | whois-cdc050a3204d46f15d176c65717bf6fa9debb088.tar.gz |
Query whois.iana.org for IDN TLDs too
Diffstat (limited to 'whois.c')
-rw-r--r-- | whois.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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))); |