为什么第二个CAA查询没有超时?

时间:2018-01-16 03:25:28

标签: node.js caching dns

我有一段node.js代码,用于检查特定域的CAA record

const dns = require('dns-socket')
const defaultDNS = '10.11.1.5'  // My DNS server
const socket = dns()

function checkCaa (domainName) {
  console.log(`domainName: ${domainName}`)
  socket.query({
    questions: [{
      type: 'CAA',
      name: domainName
    }]
  }, 53, defaultDNS, (err, res) => {
    console.error(`Error: ${err}`)
    console.log(`Response: ${JSON.stringify(res)}`)
    socket.destroy()
  })
}

checkCaa('www.babushop.com.tw')

www.babushop.com.tw是一个没有CAA记录的域。

当我第一次执行上面的代码时,程序输出:

domainName: www.babushop.com.tw
Error: Error: Query timed out
Response: undefined

从输出中可以看出,它表示查询超时。

我想知道为什么当我第二次运行它时它会给出以下输出:

domainName: www.babushop.com.tw
Error: null
Response: {"id":22260,"type":"response","flags":384,"flag_qr":true,"opcode":"QUERY","flag_auth":false,"flag_trunc":false,"flag_rd":true,"flag_ra":true,"flag_z":false,"flag_ad":false,"flag_cd":false,"rcode":"NOERROR","questions":[{"name":"www.babushop.com.tw","type":"CAA","class":"IN"}],"answers":[{"name":"www.babushop.com.tw","type":"CNAME","class":"IN","ttl":42,"flush":false,"data":"s2454.dname.91app.io"},{"name":"s2454.dname.91app.io","type":"CNAME","class":"IN","ttl":42,"flush":false,"data":"proxy.letssl.91app.io"},{"name":"proxy.letssl.91app.io","type":"CNAME","class":"IN","ttl":56,"flush":false,"data":"proxy-letssl-91app-io-196811564.ap-northeast-1.elb.amazonaws.com"}],"authorities":[],"additionals":[]}

是否在我的DNS服务器(本例中为10.11.1.5)中缓存了某些内容,以便它不会超时?

如果是这样,它是什么?

这种现象使我很难确定CAA查询是否会超时。

1 个答案:

答案 0 :(得分:0)

babushop.com.tw似乎没有很好地配置DNS(请参阅http://dnsviz.net/d/www.babushop.com.tw/dnssec/)我不希望能够检索对此区域有用的任何内容。简而言之,对于这个领域,问题显然不在你身边。