阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js dns dnsPromises.resolve

      Node.js dns dnsPromises.resolve(hostname[, rrtype])

      新增于: v10.6.0

      • hostname < string> Hostname to resolve.
      • rrtype < string> Resource record type. Default: ‘A’.

      Uses the DNS protocol to resolve a hostname (e.g. ‘nodejs.org’) into an array of the resource records. When successful, the Promise is resolved with an array of resource records. The type and structure of individual results vary based on rrtype:

      rrtyperecords containsResult typeShorthand method
      ‘A’IPv4 addresses (default)< string>dnsPromises.resolve4()
      ‘AAAA’IPv6 addresses< string>dnsPromises.resolve6()
      ‘ANY’any records< Object>dnsPromises.resolveAny()
      ‘CNAME’canonical name records< string>dnsPromises.resolveCname()
      ‘MX’mail exchange records< Object>dnsPromises.resolveMx()
      ‘NAPTR’name authority pointer records< Object>dnsPromises.resolveNaptr()
      ‘NS’name server records< string>dnsPromises.resolveNs()
      ‘PTR’pointer records< string>dnsPromises.resolvePtr()
      ‘SOA’start of authority records< Object>dnsPromises.resolveSoa()
      ‘SRV’service records< Object>dnsPromises.resolveSrv()
      ‘TXT’text records< string[]>dnsPromises.resolveTxt()

      On error, the Promise is rejected with an Error object, where err.code is one of the DNS error codes.


      更多内容请参考:Node.js dns 域名服务器,或者通过 点击对应菜单 进行查看;


      目录
      本文目录
      目录