Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/node/dns.ts>resolveSrv

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function resolveSrv
import { resolveSrv } from "https://deno.land/std@0.177.0/node/dns.ts";

Uses the DNS protocol to resolve service records (SRV records) for the hostname. The addresses argument passed to the callback function will be an array of objects with the following properties:

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

Parameters

hostname: string
callback: (err: ErrnoException | null, addresses: SrvRecord[]) => void