digコマンドでネームサーバを調べる

2022-04-08

ドメインのネームサーバを何処に設定したかdigコマンドで調べる場合は「ns」のオプションを使用します。NSのオプションを使用するとドメイン名に対応するNSレコードを取得する事ができます

$ dig onamae.com ns

; <<>> DiG 9.9.4-RedHat-9.9.4-51.el7_4.2 <<>> onamae.com ns
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35182
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 4

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;onamae.com.                    IN      NS

;; ANSWER SECTION:
onamae.com.             1893    IN      NS      ns1.gmointernet.com.
onamae.com.             1893    IN      NS      ns1.gmointernet.jp.

;; ADDITIONAL SECTION:
ns1.gmointernet.com.    1685    IN      A       157.7.32.254
ns1.gmointernet.com.    1685    IN      AAAA    2400:8500:3000::254
ns1.gmointernet.jp.     1893    IN      A       157.7.33.254

;; Query time: 0 msec
;; SERVER: 210.134.55.219#53(210.134.55.219)
;; WHEN: 水  5月 02 10:58:38 JST 2018
;; MSG SIZE  rcvd: 161

[ex-adm@v9747 ~]$ dig amazon.com ns

; <<>> DiG 9.9.4-RedHat-9.9.4-51.el7_4.2 <<>> amazon.com ns
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36246
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 9

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;amazon.com.                    IN      NS

;; ANSWER SECTION:
amazon.com.             336     IN      NS      pdns6.ultradns.co.uk.
amazon.com.             336     IN      NS      ns3.p31.dynect.net.
amazon.com.             336     IN      NS      pdns1.ultradns.net.
amazon.com.             336     IN      NS      ns4.p31.dynect.net.
amazon.com.             336     IN      NS      ns2.p31.dynect.net.
amazon.com.             336     IN      NS      ns1.p31.dynect.net.

;; ADDITIONAL SECTION:
ns3.p31.dynect.net.     3189    IN      A       208.78.71.31
ns4.p31.dynect.net.     972     IN      A       204.13.251.31
ns1.p31.dynect.net.     2572    IN      A       208.78.70.31
pdns6.ultradns.co.uk.   2378    IN      A       204.74.115.1
pdns6.ultradns.co.uk.   2378    IN      AAAA    2610:a1:1017::1
pdns1.ultradns.net.     830     IN      A       204.74.108.1
pdns1.ultradns.net.     830     IN      AAAA    2001:502:f3ff::1
ns2.p31.dynect.net.     972     IN      A       204.13.250.31

;; Query time: 0 msec
;; SERVER: 210.134.55.219#53(210.134.55.219)
;; WHEN: 水  5月 02 10:59:29 JST 2018
;; MSG SIZE  rcvd: 340