MoinQ:

1. NS/CNAME返答

Answer SectionにCNAMEレコードがあるのに、RCODE 0 ではないことがある。

ここでは、CNAMEの指す先が存在する場合の返答を調べてみる。

/例

2. A record

%dnsq a www.ygc.jp ns1.dns.ne.jp                             ~/dnsq/wwwcn
1 www.ygc.jp:
101 bytes, 1+2+2+0 records, response, authoritative, noerror
query: 1 www.ygc.jp
answer: www.ygc.jp 3600 CNAME ygc.jp
answer: ygc.jp 3600 A 49.212.207.32
authority: ygc.jp 3600 NS ns1.dns.ne.jp
authority: ygc.jp 3600 NS ns2.dns.ne.jp

%dnsq txt www.ygc.jp ns1.dns.ne.jp                           ~/dnsq/wwwcn
16 www.ygc.jp:
107 bytes, 1+1+1+0 records, response, authoritative, noerror
query: 16 www.ygc.jp
answer: www.ygc.jp 3600 CNAME ygc.jp
authority: ygc.jp 3600 SOA master.dns.ne.jp tech.sakura.ad.jp 2013052920 3600 900 3600000 3600

この返答からTXTレコードの有無は判断できるか。(できそう w)

-- ToshinoriMaeno 2018-11-29 01:49:35

3. TXT

%dnsq txt www.catal.jp 01.dnsv.jp                            ~/dnsq/wwwcn
16 www.catal.jp:
231 bytes, 1+2+4+0 records, response, authoritative, noerror
query: 16 www.catal.jp
answer: www.catal.jp 300 CNAME catal.jp
answer: catal.jp 300 16 cv=spf1\040include:_spf.google.com\040include:bmsend.com\040include:spf.satorimail.net\040ip4:183.181.98.79\040~all
authority: catal.jp 86400 NS 01.dnsv.jp
authority: catal.jp 86400 NS 02.dnsv.jp
authority: catal.jp 86400 NS 03.dnsv.jp
authority: catal.jp 86400 NS 04.dnsv.jp

4. AAAA

%dnsq aaaa www.ygc.jp ns1.dns.ne.jp                          ~/dnsq/wwwcn
28 www.ygc.jp:
42 bytes, 1+1+0+0 records, response, authoritative, noerror
query: 28 www.ygc.jp
answer: www.ygc.jp 3600 CNAME ygc.jp

%dnsq aaaa ygc.jp ns1.dns.ne.jp                              ~/dnsq/wwwcn
28 ygc.jp:
89 bytes, 1+0+1+0 records, response, authoritative, noerror
query: 28 ygc.jp
authority: ygc.jp 3600 SOA master.dns.ne.jp tech.sakura.ad.jp 2013052920 3600 900 3600000 3600

こういう返事もする。

%dig -t aaaa www.ygc.jp @ns1.dns.ne.jp.                      ~/dnsq/wwwcn

; <<>> DiG 9.12.1 <<>> -t aaaa www.ygc.jp @ns1.dns.ne.jp.
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22574
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.ygc.jp.                    IN      AAAA

;; ANSWER SECTION:
www.ygc.jp.             3600    IN      CNAME   ygc.jp.

;; AUTHORITY SECTION:
ygc.jp.                 3600    IN      SOA     master.dns.ne.jp. tech.sakura.ad.jp. 2013052920 3600 900 3600000 3600

;; Query time: 11 msec
;; SERVER: 61.211.236.1#53(61.211.236.1)
;; WHEN: Thu Nov 29 11:01:15 JST 2018

こっちの返事も。(dnsq, dig の違いではない。)

%dig -t aaaa www.ygc.jp @ns2.dns.ne.jp.                      ~/dnsq/wwwcn

; <<>> DiG 9.12.1 <<>> -t aaaa www.ygc.jp @ns2.dns.ne.jp.
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23634
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.ygc.jp.                    IN      AAAA

;; ANSWER SECTION:
www.ygc.jp.             3600    IN      CNAME   ygc.jp.

;; Query time: 8 msec
;; SERVER: 133.167.21.1#53(133.167.21.1)
;; WHEN: Thu Nov 29 11:02:55 JST 2018
;; MSG SIZE  rcvd: 53

%dnsq aaaa www.catal.jp 01.dnsv.jp                           ~/dnsq/wwwcn
28 www.catal.jp:
44 bytes, 1+1+0+0 records, response, authoritative, noerror
query: 28 www.catal.jp
answer: www.catal.jp 300 CNAME catal.jp

この返事ではAAAAの有無は不明か。-- ToshinoriMaeno 2018-11-29 02:02:45

%dnsq aaaa www.accessplus.jp ns1.accessplus.jp               ~/dnsq/wwwcn
28 www.accessplus.jp:
110 bytes, 1+1+1+0 records, response, authoritative, noerror
query: 28 www.accessplus.jp
answer: www.accessplus.jp 86400 CNAME accessplus.jp
authority: accessplus.jp 10800 SOA ns1.accessplus.jp contact\056rep.gmail.com 1365529778 10800 3600 604800 10800

MoinQ: DNS/CNAME/返答 (last edited 2022-10-27 11:23:41 by ToshinoriMaeno)