Skip to content

Commit

Permalink
Improve getServer() parser
Browse files Browse the repository at this point in the history
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
  • Loading branch information
zcalusic committed Oct 11, 2022
1 parent a7337df commit 854e555
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions whois.go
Expand Up @@ -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, "/")
Expand Down

0 comments on commit 854e555

Please sign in to comment.