mochikoAsTechのdig日記

当方好きなコマンドはdigです!お友達から!!よろしくお願いします!!!

グルーレコードの確認方法

いったん、+traceで親のDNSコンテンツサーバを調べて、

$ dig infra.xyz +trace

; <<>> DiG 9.10.0-P1 <<>> infra.xyz +trace
;; global options: +cmd
.                       346259  IN      NS      h.root-servers.net.
.                       346259  IN      NS      j.root-servers.net.
.                       346259  IN      NS      k.root-servers.net.
.                       346259  IN      NS      g.root-servers.net.
.                       346259  IN      NS      l.root-servers.net.
.                       346259  IN      NS      i.root-servers.net.
.                       346259  IN      NS      f.root-servers.net.
.                       346259  IN      NS      c.root-servers.net.
.                       346259  IN      NS      b.root-servers.net.
.                       346259  IN      NS      m.root-servers.net.
.                       346259  IN      NS      d.root-servers.net.
.                       346259  IN      NS      a.root-servers.net.
.                       346259  IN      NS      e.root-servers.net.
.                       347445  IN      RRSIG   NS 8 0 518400 20150224050000 20150214040000 16665 . 49XDs9Icoki4ReHy1mUexld6E7w8xCb7NTXMlie4bckAQ2p61KjzkhbJ 89DT98Xpc2IcfJy1TWgee2CTthYXXbLuuhEJdZEUrlJW2ku2IjSaEH3L JlriAwtHgrziIKgWseXAxUVJc7/w+QoYd9XV7oIOHwL3Q8MH65ako+z2 nm8=
;; Received 913 bytes from 127.0.0.1#53(127.0.0.1) in 14 ms

xyz.                    172800  IN      NS      z.nic.xyz.
xyz.                    172800  IN      NS      y.nic.xyz.
xyz.                    172800  IN      NS      x.nic.xyz.
xyz.                    172800  IN      NS      generationxyz.nic.xyz.
xyz.                    86400   IN      DS      3599 8 1 3FA3B264F45DB5F38BEDEAF1A88B76AA318C2C7F
xyz.                    86400   IN      DS      3599 8 2 B9733869BC84C86BB59D102BA5DA6B27B2088552332A39DCD54BC4E8 D66B0499
xyz.                    86400   IN      RRSIG   DS 8 1 86400 20150226050000 20150216040000 16665 . 2wVBaGY2zO+b1jX12HPs7Ly0za90q+AtGM5tm3fRyOrDpCQt1XD0iJnc ij2jWuXWWXL8005Qqvi5C/gRiGJswfChKuX4J4/OKGGPzSVjxGynuEQu m3hTUtFWNESuGRAqS1zlsypFRP9O8mpaTamHRxamcQuvDSrbZBLpTbb3 sOU=
;; Received 537 bytes from 192.33.4.12#53(c.root-servers.net) in 122 ms

infra.xyz.              3600    IN      NS      ns1.infra.xyz.
infra.xyz.              3600    IN      NS      ns2.infra.xyz.
1h97h2oec2juov8dlbbjj6i7ik26bm8d.xyz. 3600 IN NSEC3 1 1 1 - 1KKABMBG1LO63FOI21UHUBCQJDM5D2RM NS SOA RRSIG DNSKEY NSEC3PARAM
1h97h2oec2juov8dlbbjj6i7ik26bm8d.xyz. 3600 IN RRSIG NSEC3 8 2 3600 20150311130404 20150209214037 38328 xyz. teRlK0XJ4/Z4SmzTdI3idnwN4Zf4rLHYBap/w0KV34CB6ICtkWsBM1bk hWS4jSQ6XrjFO/OrOEKvgl/DcoyYiEsijJkcqo364JYAVUCzK1cdHlJQ efbZjruxLPEoe+34jb6gZvuY15huradsTnEnyDKQraMuOnLCUpqqiKun L9E=
jap3nebfhkg51v8uie6lh8n8fm536euf.xyz. 3600 IN NSEC3 1 1 1 - JTBA28MNE9VHFM3561JQOEB66MS83DLK NS DS RRSIG
jap3nebfhkg51v8uie6lh8n8fm536euf.xyz. 3600 IN RRSIG NSEC3 8 2 3600 20150315190829 20150213161936 38328 xyz. ctm4qzSZRJt9gww/VHZ7PhDS8bEkpaRdkSi2FqyIf+hBA83Z7nWvQGUN Ubxd/kgR37gd3NDXoFXiJ3jhYBqJn6Ejfv9kPCv08kjEJ2lQ9W6wfSnA z8Fw67+SvQlwOIntcuDGvW7eL7He5B0C2VmQXVhLhI8dBzpbYR8tMove VCc=
;; Received 591 bytes from 185.24.64.42#53(y.nic.xyz) in 137 ms

infra.xyz.              600     IN      A       153.121.58.159
infra.xyz.              600     IN      NS      ns2.infra.xyz.
infra.xyz.              600     IN      NS      ns1.infra.xyz.
;; Received 122 bytes from 153.121.58.159#53(ns1.infra.xyz) in 0 ms

親(z.nic.xyz)に向かって問い合わせると、AUTHORITY SECTIONとADDITIONAL SECTIONにグルーレコードの情報が表示される。

$  dig infra.xyz @z.nic.xyz

; <<>> DiG 9.10.0-P1 <<>> infra.xyz @z.nic.xyz
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37776
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 2, ADDITIONAL: 3
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;infra.xyz.                     IN      A

;; AUTHORITY SECTION:
infra.xyz.              3600    IN      NS      ns1.infra.xyz.
infra.xyz.              3600    IN      NS      ns2.infra.xyz.

;; ADDITIONAL SECTION:
ns1.infra.xyz.          3600    IN      A       153.121.58.159
ns2.infra.xyz.          3600    IN      A       153.121.58.159

;; Query time: 55 msec
;; SERVER: 2a04:2b00:13ee::42#53(2a04:2b00:13ee::42)
;; WHEN: Mon Feb 16 23:22:27 JST 2015
;; MSG SIZE  rcvd: 106

ちなみに、何も指定せずに普通に問い合わせた時に出るAUTHORITY SECTIONとADDITIONAL SECTIONは、グルーレコードの値ではなく、実際のDNSコンテンツサーバ(今回の例で言えばns1.infra.xyzとns2.infra.xyz)で設定されているNSレコードとAレコードの値なので注意。