kresd/exampleについて、ここに記述してください。

/a.b.c.d.e.co.jp /nic.cz

$ dig jprs.co.jp @127.0.0.3

実行時のkresd logを見てみる。

> cachectl.clear()
true

> [plan] plan 'jprs.co.jp.' type 'A'
kr_zonecut_find_cached jprscojp
kr_zonecut_find_cached cojp
kr_zonecut_find_cached jp
kr_zonecut_find_cached 
[resl]   ns_fetch_cut ret -2
[resl]   zone_cut_check -> ns_fetch_cut = -2
[resl]   => using root hints
[resl]   

root-servers の情報はhintsから得る。

JP NS情報をroot-servers に問い合わせる。

=> querying: '202.12.27.33' score: 10 zone cut: '.' m12n: 'JP.' type: 'NS'
[resl]   
   optional: '199.7.83.42' score: 10 zone cut: '.' m12n: 'JP.' type: 'NS'
[resl]   
   optional: '193.0.14.129' score: 10 zone cut: '.' m12n: 'JP.' type: 'NS'
[resl]   
   optional: '192.58.128.30' score: 10 zone cut: '.' m12n: 'JP.' type: 'NS'
[iter]   Update zone cut 
[iter]   zonecut_add jp NS adnsjp
[iter]   <= using glue for 'a.dns.jp.'
[iter]   Update zone cut jp
[iter]   zonecut_add jp NS bdnsjp
[iter]   <= using glue for 'b.dns.jp.'
[iter]   Update zone cut jp
[iter]   zonecut_add jp NS cdnsjp
[iter]   <= using glue for 'c.dns.jp.'
[iter]   Update zone cut jp
[iter]   zonecut_add jp NS ddnsjp
[iter]   <= using glue for 'd.dns.jp.'
[iter]   Update zone cut jp
[iter]   zonecut_add jp NS ednsjp
[iter]   <= using glue for 'e.dns.jp.'
[iter]   Update zone cut jp
[iter]   zonecut_add jp NS fdnsjp
[iter]   <= using glue for 'f.dns.jp.'
[iter]   Update zone cut jp
[iter]   zonecut_add jp NS gdnsjp
[iter]   <= using glue for 'g.dns.jp.'
[iter]   <= referral response, follow
[ rc ]   stash referral NS
[ rc ]   stash auth for jp
[ rc ]   stash auth for jp
[ rc ]   stash auth for jp
[ rc ]   stash auth for jp
[ rc ]   stash auth for jp
[ rc ]   stash auth for jp
[ rc ]   stash auth for jp
[ pc ]   => pktcache_stash entry
[resl]   <= server: '199.7.83.42' rtt: 452 ms

JPサーバのNS+glueを保存した。(zone cutの記録)

[resl]   
=> querying: '203.119.40.1' score: 10 zone cut: 'jp.' m12n: 'Co.Jp.' type: 'NS'
[resl]   
   optional: '150.100.6.8' score: 10 zone cut: 'jp.' m12n: 'Co.Jp.' type: 'NS'
[resl]   
   optional: '192.50.43.53' score: 10 zone cut: 'jp.' m12n: 'Co.Jp.' type: 'NS'
[resl]   
   optional: '210.138.175.244' score: 10 zone cut: 'jp.' m12n: 'Co.Jp.' type: 'NS'
[iter]   AA terminate resolution chain
[iter]   <= rcode: NOERROR
[iter]   <= found cut, retrying with non-minimized name
[ rc ]   stash auth answer 
[ pc ]   => pktcache_stash entry
[ pc ]   => pktcache_stash NXDOMAIN
[ pc ]   => pktcache_stash answer
[ pc ]   => answer cached for TTL=900
[resl]   <= server: '203.119.40.1' rtt: 15 ms

co.jpはゾーンではないことが分かる。(そのことを記録する)

[resl]   
=> querying: '150.100.6.8' score: 10 zone cut: 'jp.' m12n: 'Jprs.CO.jP.' type: 'A'
[resl]   
   optional: '192.50.43.53' score: 10 zone cut: 'jp.' m12n: 'Jprs.CO.jP.' type: 'A'
[resl]   
   optional: '210.138.175.244' score: 10 zone cut: 'jp.' m12n: 'Jprs.CO.jP.' type: 'A'
[resl]   
   optional: '156.154.100.5' score: 10 zone cut: 'jp.' m12n: 'Jprs.CO.jP.' type: 'A'
[iter]   Update zone cut jp
[iter]   zonecut_add jprscojp NS ns3jprscojp
[iter]   <= using glue for 'ns3.jprs.co.jp.'
[iter]   Update zone cut jprscojp
[iter]   zonecut_add jprscojp NS ns1jprscojp
[iter]   <= using glue for 'ns1.jprs.co.jp.'
[iter]   Update zone cut jprscojp
[iter]   zonecut_add jprscojp NS ns2jprscojp
[iter]   <= using glue for 'ns2.jprs.co.jp.'
[iter]   <= referral response, follow
[ rc ]   stash referral NS
[ rc ]   stash auth for jprscojp
[ rc ]   stash auth for jprscojp
[ rc ]   stash auth for jprscojp
[ pc ]   => pktcache_stash entry
[resl]   <= server: '150.100.6.8' rtt: 7 ms

委譲/委任が返ってくるので、glueとともに記録する。

jprs.co.jp NSにAを問い合わせる。

[resl]   
=> querying: '61.200.83.204' score: 10 zone cut: 'jprs.co.jp.' m12n: 'jPrS.CO.JP.' type: 'A'
[resl]   
   optional: '202.11.16.59' score: 10 zone cut: 'jprs.co.jp.' m12n: 'jPrS.CO.JP.' type: 'A'
[resl]   
   optional: '202.11.16.49' score: 10 zone cut: 'jprs.co.jp.' m12n: 'jPrS.CO.JP.' type: 'A'
[iter]   AA terminate resolution chain
[iter]   <= rcode: NOERROR
[ rc ]   stash auth answer 
[ pc ]   => pktcache_stash entry
[resl]   <= server: '61.200.83.204' rtt: 16 ms
[resl] finished: 4, queries: 1, mempool: 16400 B

Aレコード返答をもらって、これで目的は達成。

-- ToshinoriMaeno 2016-04-24 08:07:20

/つづき /3

毒が入っていそうな返答に気づいただろうか。