最近ドメインに関する情報を調べたいと思ったので、今回はLinuxやMacのコマンドで利用できる whois コマンドに関して記事を書きたいと思います!
今回は基本的な使い方をメインで紹介できればと思います。
whoisコマンドとはドメイン名やIPアドレスの登録情報を調べるコマンドです。
「このウェブサイトは誰ば運営しているのだろうか?」「このドメインはいつ登録されたの??」
といった疑問を解決・確認できる便利なコマンドです。
インストール方法
調べたところ、一部Linux(Ubuntu)ではwhoisコマンドが利用できないみたいで、下記のコマンドのように一度インストール必要がある場合があります。
$ apt install whois
私の環境はMacなのですが、Macはデフォルトでこのコマンドが利用できます。
基本的な使い方
この方法は一番シンプルな方法です。
調べたいドメイン名を下記のように指定するだけで良いです。
$ whois example.com
このコマンドを実行すると下記のような情報が取得できます。
$ whois example.com
% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object
domain: EXAMPLE.COM
organisation: Internet Assigned Numbers Authority
created: 1992-01-01
source: IANA
ドメイン名同様、IPアドレスを指定することで調べることができます。
$ whois 8.8.8.8
$ whois 8.8.8.8
% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object
refer: whois.arin.net
inetnum: 8.0.0.0 - 8.255.255.255
organisation: Administered by ARIN
status: LEGACY
whois: whois.arin.net
changed: 1992-12
source: IANA
# whois.arin.net
NetRange: 8.8.8.0 - 8.8.8.255
CIDR: 8.8.8.0/24
NetName: GOGL
NetHandle: NET-8-8-8-0-2
Parent: NET8 (NET-8-0-0-0-0)
NetType: Direct Allocation
OriginAS:
Organization: Google LLC (GOGL)
RegDate: 2023-12-28
Updated: 2023-12-28
Ref: https://rdap.arin.net/registry/ip/8.8.8.0
OrgName: Google LLC
OrgId: GOGL
Address: 1600 Amphitheatre Parkway
City: Mountain View
StateProv: CA
PostalCode: 94043
Country: US
RegDate: 2000-03-30
Updated: 2019-10-31
Comment: Please note that the recommended way to file abuse complaints are located in the following links.
Comment:
Comment: To report abuse and illegal activity: https://www.google.com/contact/
Comment:
Comment: For legal requests: http://support.google.com/legal
Comment:
Comment: Regards,
Comment: The Google Team
Ref: https://rdap.arin.net/registry/entity/GOGL
OrgTechHandle: ZG39-ARIN
OrgTechName: Google LLC
OrgTechPhone: +1-650-253-0000
OrgTechEmail: [email protected]
OrgTechRef: https://rdap.arin.net/registry/entity/ZG39-ARIN
OrgAbuseHandle: ABUSE5250-ARIN
OrgAbuseName: Abuse
OrgAbusePhone: +1-650-253-0000
OrgAbuseEmail: [email protected]
OrgAbuseRef: https://rdap.arin.net/registry/entity/ABUSE5250-ARIN
これでGoogleのDNSサーバーの情報が分かります。
どんな情報がわかるのか
whoisコマンドで確認できる主な情報
google.com で確認してみたいと思います!
$ whois google.com
$ whois google.com
% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object
refer: whois.verisign-grs.com
domain: COM
organisation: VeriSign Global Registry Services
address: 12061 Bluemont Way
address: Reston VA 20190
address: United States of America (the)
contact: administrative
name: Registry Customer Service
organisation: VeriSign Global Registry Services
address: 12061 Bluemont Way
address: Reston VA 20190
address: United States of America (the)
phone: +1 703 925-6999
fax-no: +1 703 948 3978
e-mail: [email protected]
contact: technical
name: Registry Customer Service
organisation: VeriSign Global Registry Services
address: 12061 Bluemont Way
address: Reston VA 20190
address: United States of America (the)
phone: +1 703 925-6999
fax-no: +1 703 948 3978
e-mail: [email protected]
nserver: A.GTLD-SERVERS.NET 192.5.6.30 2001:503:a83e:0:0:0:2:30
nserver: B.GTLD-SERVERS.NET 192.33.14.30 2001:503:231d:0:0:0:2:30
nserver: C.GTLD-SERVERS.NET 192.26.92.30 2001:503:83eb:0:0:0:0:30
nserver: D.GTLD-SERVERS.NET 192.31.80.30 2001:500:856e:0:0:0:0:30
nserver: E.GTLD-SERVERS.NET 192.12.94.30 2001:502:1ca1:0:0:0:0:30
nserver: F.GTLD-SERVERS.NET 192.35.51.30 2001:503:d414:0:0:0:0:30
nserver: G.GTLD-SERVERS.NET 192.42.93.30 2001:503:eea3:0:0:0:0:30
nserver: H.GTLD-SERVERS.NET 192.54.112.30 2001:502:8cc:0:0:0:0:30
nserver: I.GTLD-SERVERS.NET 192.43.172.30 2001:503:39c1:0:0:0:0:30
nserver: J.GTLD-SERVERS.NET 192.48.79.30 2001:502:7094:0:0:0:0:30
nserver: K.GTLD-SERVERS.NET 192.52.178.30 2001:503:d2d:0:0:0:0:30
nserver: L.GTLD-SERVERS.NET 192.41.162.30 2001:500:d937:0:0:0:0:30
nserver: M.GTLD-SERVERS.NET 192.55.83.30 2001:501:b1f9:0:0:0:0:30
ds-rdata: 19718 13 2 8acbb0cd28f41250a80a491389424d341522d946b0da0c0291f2d3d771d7805a
whois: whois.verisign-grs.com
status: ACTIVE
remarks: Registration information: http://www.verisigninc.com
created: 1985-01-01
changed: 2023-12-07
source: IANA
# whois.verisign-grs.com
Domain Name: GOOGLE.COM
Registry Domain ID: 2138514_DOMAIN_COM-VRSN
Registrar WHOIS Server: whois.markmonitor.com
Registrar URL: http://www.markmonitor.com
Updated Date: 2019-09-09T15:39:04Z
Creation Date: 1997-09-15T04:00:00Z
Registry Expiry Date: 2028-09-14T04:00:00Z
Registrar: MarkMonitor Inc.
Registrar IANA ID: 292
Registrar Abuse Contact Email: [email protected]
Registrar Abuse Contact Phone: +1.2086851750
Domain Status: clientDeleteProhibited https://icann.org/epp#clientDeleteProhibited
Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
Domain Status: clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited
Domain Status: serverDeleteProhibited https://icann.org/epp#serverDeleteProhibited
Domain Status: serverTransferProhibited https://icann.org/epp#serverTransferProhibited
Domain Status: serverUpdateProhibited https://icann.org/epp#serverUpdateProhibited
Name Server: NS1.GOOGLE.COM
Name Server: NS2.GOOGLE.COM
Name Server: NS3.GOOGLE.COM
Name Server: NS4.GOOGLE.COM
DNSSEC: unsigned
URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
>>> Last update of whois database: 2025-11-02T10:47:16Z <<<
# whois.markmonitor.com
Domain Name: google.com
Registry Domain ID: 2138514_DOMAIN_COM-VRSN
Registrar WHOIS Server: whois.markmonitor.com
Registrar URL: http://www.markmonitor.com
Updated Date: 2024-08-02T02:17:33+0000
Creation Date: 1997-09-15T07:00:00+0000
Registrar Registration Expiration Date: 2028-09-13T07:00:00+0000
Registrar: MarkMonitor, Inc.
Registrar IANA ID: 292
Registrar Abuse Contact Email: [email protected]
Registrar Abuse Contact Phone: +1.2086851750
Domain Status: clientUpdateProhibited (https://www.icann.org/epp#clientUpdateProhibited)
Domain Status: clientTransferProhibited (https://www.icann.org/epp#clientTransferProhibited)
Domain Status: clientDeleteProhibited (https://www.icann.org/epp#clientDeleteProhibited)
Domain Status: serverUpdateProhibited (https://www.icann.org/epp#serverUpdateProhibited)
Domain Status: serverTransferProhibited (https://www.icann.org/epp#serverTransferProhibited)
Domain Status: serverDeleteProhibited (https://www.icann.org/epp#serverDeleteProhibited)
Registrant Organization: Google LLC
Registrant Country: US
Registrant Email: Select Request Email Form at https://domains.markmonitor.com/whois/google.com
Tech Email: Select Request Email Form at https://domains.markmonitor.com/whois/google.com
Name Server: ns3.google.com
Name Server: ns4.google.com
Name Server: ns2.google.com
Name Server: ns1.google.com
DNSSEC: unsigned
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
>>> Last update of WHOIS database: 2025-11-02T10:46:00+0000 <<<
分かること
- ドメイン名:
Domain Name: google.com
- 登録日:
Creation Date: 1997-09-15T07:00:00+0000
- 有効期限:
Registrar Registration Expiration Date: 2028-09-13T07:00:00+0000
- 最終更新日:
Updated Date: 2019-09-09T15:39:04Z
2. 所有者情報
分かること
- 組織名(会社名など):
Registrant Organization: Google LLC
- 国名:
Registrant Country: US
- 連絡先情報:
Registrant Email: Select Request Email Form at https://domains.markmonitor.com/whois/google.com
※ WHOIS 情報の中には 所有者(Registrant)情報 が含まれていますが、現在は 個人情報保護の観点からマスク(非公開化)されています。
今回の場合だと、連絡先情報は直接は記載がなく、「Select Request Email Form at ...」と書かれてます。実際のメールアドレスは非公開(問い合わせフォーム経由)になっています。
分かること
- どこでドメインを登録したか:
Registrar: MarkMonitor, Inc.
- 登録会社の連絡先:
Registrar Abuse Contact Email: [email protected]
Registrar Abuse Contact Phone: +1.2086851750
4. DNSサーバー情報
分かること
Name Server: NS1.GOOGLE.COM
Name Server: NS2.GOOGLE.COM
Name Server: NS3.GOOGLE.COM
Name Server: NS4.GOOGLE.COM
いろいろな使い方
必要な情報だけを表示
そのまま使用するとたくさんの情報が表示されます。
全部の情報は多すぎるので、欲しい情報だけ抽出することも可能です。
下記のコマンドで、特定の文字列を検索してその行だけ出力できます。
※ name serverの箇所を他の文字に変えることで、検索対象の文字を変更することが可能。
$ whois google.com | grep -i "name server"
コマンドの実際の動き
whois example.com
→ example.com の WHOIS情報を取得 (登録者、登録日、有効期限、DNS情報などが含まれる)
| パイプ
→ 出力を次のコマンド grep に渡す
grep -i "name server"
→ 「name server」という文字列を(大文字小文字を区別せず)検索し、その行だけ表示
怪しいサイトをチェック
フィッシングサイトかも?と思ったら whois コマンドを用いて下記の項目を確認
- 登録日が最近(数日前とか)
- 所有者情報が全部隠されている
- 聞いたことない登録会社
結果をファイルに保存
WHOIS情報をdomain_info.txtというファイルに書き出すことが可能
※ domain_info.txtは任意のファイル名を指定してください。
$ whois example.com > domain_info.txt
まとめ
whoisコマンドは、たった1行でドメインの情報が分かる便利なツールです。
ドメインの有効期限をチェックしたい、サイトの運営者を確認したい、怪しいサイトを調べたい、DNSサーバーを確認したい
上記のようなことを確認したい場合にとても便利です!
思ったより簡単に使えるコマンドなので、まずは自分の知っているサイトで気軽に試してみてください!
ここまで読んでいただきありがとうございました!もし何かあればコメントなどいただけると嬉しいです!