Command disabled: index
̃Gg[͂ĂȃubN}[Nɒlj

Unix :: コマンド / dig



コマンド説明
digdig (domain information groper) は、 DNS (DomainName System) サーバから情報を集めるために使われる柔軟なコマンドラインツールです


ホスト名からIPアドレスを調べる

% dig yahoo.co.jp

; <<>> DiG 9.3.4 <<>> yahoo.co.jp
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27368
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;yahoo.co.jp.                   IN      A

;; ANSWER SECTION:
yahoo.co.jp.            300     IN      A       203.216.227.176
yahoo.co.jp.            300     IN      A       124.83.139.192

;; AUTHORITY SECTION:
yahoo.co.jp.            484     IN      NS      dnsg01.yahoo.co.jp.
yahoo.co.jp.            484     IN      NS      ns10.yahoo.co.jp.

 :
(略)
 :

ANSWER SECTION から
203.216.227.176124.83.139.192 であることが分かる



ホスト名からMXレコード(Mail Exchange)を調べる

% dig yahoo.co.jp mx

; <<>> DiG 9.3.4 <<>> yahoo.co.jp mx
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13326
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 5, ADDITIONAL: 17

;; QUESTION SECTION:
;yahoo.co.jp.                   IN      MX

;; ANSWER SECTION:
yahoo.co.jp.            404     IN      MX      10 mx3.mail.yahoo.co.jp.
yahoo.co.jp.            404     IN      MX      10 mx5.mail.yahoo.co.jp.
yahoo.co.jp.            404     IN      MX      10 mx1.mail.yahoo.co.jp.
yahoo.co.jp.            404     IN      MX      10 mx2.mail.yahoo.co.jp.

 :
(略)
 :

ANSWER SECTION から
mx{1,2,3,5}.mail.yahoo.co.jp であることが分かる



ホスト名からすべての情報を調べる

% dig yahoo.co.jp any

; <<>> DiG 9.3.4 <<>> yahoo.co.jp any
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3786
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 5, ADDITIONAL: 17

;; QUESTION SECTION:
;yahoo.co.jp.                   IN      ANY

;; ANSWER SECTION:
yahoo.co.jp.            339     IN      MX      10 mx5.mail.yahoo.co.jp.
yahoo.co.jp.            339     IN      MX      10 mx1.mail.yahoo.co.jp.
yahoo.co.jp.            339     IN      MX      10 mx2.mail.yahoo.co.jp.
yahoo.co.jp.            339     IN      MX      10 mx3.mail.yahoo.co.jp.

;; AUTHORITY SECTION:
jp.                     38102   IN      NS      D.dns.jp.
jp.                     38102   IN      NS      E.dns.jp.
jp.                     38102   IN      NS      F.dns.jp.
jp.                     38102   IN      NS      a.dns.jp.
jp.                     38102   IN      NS      B.dns.jp.

;; ADDITIONAL SECTION:
mx1.mail.yahoo.co.jp.   339     IN      A       203.216.243.173
mx1.mail.yahoo.co.jp.   339     IN      A       124.83.155.153
mx1.mail.yahoo.co.jp.   339     IN      A       124.147.39.209
mx1.mail.yahoo.co.jp.   339     IN      A       203.216.243.171
mx2.mail.yahoo.co.jp.   339     IN      A       124.147.39.208
mx2.mail.yahoo.co.jp.   339     IN      A       203.216.243.170
mx2.mail.yahoo.co.jp.   339     IN      A       124.83.171.181
mx2.mail.yahoo.co.jp.   339     IN      A       124.83.171.182
mx3.mail.yahoo.co.jp.   339     IN      A       203.216.247.183
mx3.mail.yahoo.co.jp.   339     IN      A       203.216.247.184
mx3.mail.yahoo.co.jp.   339     IN      A       124.147.39.207
mx3.mail.yahoo.co.jp.   339     IN      A       203.216.243.172
mx5.mail.yahoo.co.jp.   339     IN      A       203.216.247.181
mx5.mail.yahoo.co.jp.   339     IN      A       203.216.247.182
mx5.mail.yahoo.co.jp.   339     IN      A       124.83.179.206
mx5.mail.yahoo.co.jp.   339     IN      A       124.83.183.240
B.dns.jp.               61991   IN      A       202.12.30.131

;; Query time: 4 msec
;; SERVER: 192.168.10.254#53(192.168.10.254)
;; WHEN: Sun Feb 10 22:18:37 2007
;; MSG SIZE  rcvd: 470



unix/command/dig.txt