
whois
コマンドに whois サーバーを追加するようにコマンドを構成する方法を知っている人はいますかwhois
?
whois
参考までに: OSX にあるものではありません。Apple バージョンで投稿したかったのですが、こちらの方が成功するだろうと思いました...
答え1
Mac OS Xバイナリには、whois サーバーとして任意のホストを指定できるオプションwhois
など、多くのオプションが組み込まれています。-h
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 が示したとおり)。私の知る限り、これを永続的に設定できる構成ファイルは存在しません。おそらく、次のようなシェル関数を使用するのが最善の代替手段です。
whois() { command whois -h whois.example.com "$@" ; }