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

std/node/dns.ts>getServers

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

Returns an array of IP address strings, formatted according to RFC 5952, that are currently configured for DNS resolution. A string will include a port section if a custom port is used.

[
  '4.4.4.4',
  '2001:4860:4860::8888',
  '4.4.4.4:1053',
  '[2001:4860:4860::8888]:1053',
]

Returns

string[]