dns.resolve6(hostname[, options], callback)


  • hostname <string> 要解析的主机名。
  • options <Object>
    • ttl <boolean> 获取每条记录的生存时间(TTL)值。当设置为 true 时,回调函数将接收一个 { address: '0:1:2:3:4:5:6:7', ttl: 60 } 对象的数组,而不是字符串数组,TTL 以秒为单位表示。
  • callback <Function>
    • err <Error>
    • addresses 字符串数组 | 对象数组

使用 DNS 协议解析 hostname 的 IPv6 地址(AAAA 记录)。传递给 callback 函数的 addresses 参数将包含一个 IPv6 地址数组。

🌐 Uses the DNS protocol to resolve IPv6 addresses (AAAA records) for the hostname. The addresses argument passed to the callback function will contain an array of IPv6 addresses.