dnsPromises.resolveSrv(hostname)


使用 DNS 协议解析 hostname 的服务记录(SRV 记录)。成功时,Promise 会解析为包含以下属性的对象数组:

【Uses the DNS protocol to resolve service records (SRV records) for the hostname. On success, the Promise is resolved with an array of objects with the following properties:】

  • priority
  • weight
  • port
  • name
{
  priority: 10,
  weight: 5,
  port: 21223,
  name: 'service.example.com'
}