Description
A common package whois (1) is available on macOS and most of the Linux distros. Its source code can be found on:
https://github.com/rfc1036/whois
In that repo, there is a hard-coded file tld_serv_list:
https://raw.githubusercontent.com/rfc1036/whois/master/tld_serv_list
We could also use that as a source of auto-discovering the whois server. whois (1) is used by millions possibly more and IMHO we could trust that list.