host

ネットワーク

書き方

host [-t <type>] <name> [server]

名前を尋ねると住所とメールサーバーを二、三行で短く答えます。手早い確認には一番楽ですが、記録をすべて見るには dig が必要です。

よく使うオプション

オプション意味
-t MXRestrict to one record type.
-aEverything, equivalent to -t ANY -v.
-vVerbose output closer to what dig prints.
-CFetch the SOA from every authoritative server, to spot one that is out of sync.
<ip>Give it an address and it does the reverse lookup by itself.

host example.com

Addresses and mail servers in three short lines.

host -t TXT example.com

Read the SPF or verification records.

host 8.8.8.8

Reverse lookup without needing -x.

つながらないとき、どこまで行けたのかを絞ります — 名前が引けないのか、経路がないのか、ポートが閉じているのか。

読み方

  • 角括弧 [ ] は省いてよい部分です。
  • 三点 … は複数並べられるという意味です。
  • オプションは大文字小文字を区別します — -r と -R が別物のコマンドもあります。

よくある質問

Q. host は何をしますか。

名前を尋ねると住所とメールサーバーを二、三行で短く答えます。手早い確認には一番楽ですが、記録をすべて見るには dig が必要です。

Q. どう打ちますか。

host [-t <type>] <name> [server] — 角括弧は省いてよい部分です。

Q. よく使うオプションはいくつですか。

ここにまとめたのは5個です。全部は man host にあります。このコマンドはネットワークの仲間です。

関連するコマンド

man ページ: man host