新增“whois”伺服器

新增“whois”伺服器

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

僅供參考:它不是whoisOSX 上的那個。本來會在蘋果版本中發布,但我想我會在這裡獲得更多成功...

答案1

Mac OS X二whois進位檔案有許多內建選項,包括-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 "$@" ; }

相關內容