From 854e55551dcd19557c808f103949c4405995bf16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zlatko=20=C4=8Calu=C5=A1i=C4=87?= Date: Tue, 11 Oct 2022 20:32:58 +0200 Subject: [PATCH] Improve getServer() parser Fixes this error: connect to whois server failed: dial tcp: lookup tcp///whois.namecheap.com: Servname not supported for ai_socktype Observed on an org TLD domain, whose whois response contains: Registrar WHOIS Server: http://whois.namecheap.com --- whois.go | 1 + 1 file changed, 1 insertion(+) diff --git a/whois.go b/whois.go index d9a7ce0..3295266 100644 --- a/whois.go +++ b/whois.go @@ -227,6 +227,7 @@ func getServer(data string) (string, string) { start += len(token) end := strings.Index(data[start:], "\n") server := strings.TrimSpace(data[start : start+end]) + server = strings.TrimPrefix(server, "http:") server = strings.TrimPrefix(server, "whois:") server = strings.TrimPrefix(server, "rwhois:") server = strings.Trim(server, "/")