likexian / whois

Whois client for domain and ip whois information query in Go(Golang).
Apache License 2.0
404 stars 76 forks source link

Error using custom whois server #29

Closed vladtreny closed 1 year ago

vladtreny commented 1 year ago

If we use a custom whois server, like, whois.biz

txt, err := c.Whois("excellentlife.biz", "whois.biz")

here will get a double query

https://github.com/likexian/whois/blob/da2a39f728fcd78812b314020428cb95e5b75d21/whois.go#L137

The first query will go to whois.biz and return valid data, but then instead of returning this valid response, it will query the default server and return error (biz server used in this library is unstable).

Should be something like that on #L137

result, err = c.rawQuery(domain, server, port)
if err != nil {
    return "", err
} else {
    return 
}
likexian commented 1 year ago

Hello @vladtreny I can't reproduce this. If the whois server return by whois.biz is the same as whois.biz, it will not doing a double query.


If you think this repository is helpful, please share it with friends, thanks.