添加“whois”服务器

添加“whois”服务器

有谁知道如何配置whois命令以添加whois命令的 whois 服务器?

仅供参考:它不是whoisOSX 上的那个。本来会在苹果版本中发布,但我想我会在这里获得更多成功......

答案1

Mac OS Xwhois二进制文件有很多内置选项,包括-h允许您指定任何主机作为 whois 服务器的选项。

     The whois utility looks up records in the databases maintained by several Network Information Centers (NICs).

 The options are as follows:

 -6      Use the IPv6 Resource Center (6bone) database.  It contains network names and addresses for the IPv6 net-
         work.

 -A      Use the Asia/Pacific Network Information Center (APNIC) database.  It contains network numbers used in
         East Asia, Australia, New Zealand, and the Pacific islands.

 -a      Use the American Registry for Internet Numbers (ARIN) database.  It contains network numbers used in
         those parts of the world covered neither by APNIC nor by RIPE.

         (Hint: All point of contact handles in the ARIN whois database end with "-ARIN".)

 -b      Use the Network Abuse Clearinghouse database.  It contains addresses to which network abuse should be
         reported, indexed by domain name.

 -c country-code
         This is the equivalent of using the -h option with an argument of "country-code.whois-servers.net".

 -d      Use the US Department of Defense database.  It contains points of contact for subdomains of .MIL.

 -g      Use the US non-military federal government database, which contains points of contact for subdomains of
         .GOV.

 -h host
         Use the specified host instead of the default variant.  Either a host name or an IP address may be speci-
         fied.

您需要知道的是哪个选项对应于您要搜索的 whois 服务器。

如果您想实际向 whois 添加一个指向新服务器的搜索选项,您需要源代码,以便可以重新编译它。如果运行strings /usr/bin/whois,您会注意到与上面列出的选项相关的服务器实际上被硬编码到二进制文件中。

答案2

whois与 OSX 捆绑在一起有一个-h开关(如 Tim 所示),它指定要使用的主机。据我所知,没有可以永久设置此设置的配置文件 - 最好的替代方案可能是使用类似于以下内容的 shell 函数:

whois() { command whois -h whois.example.com "$@" ; }

相关内容