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

std/node/dns.ts>resolve4

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

Uses the DNS protocol to resolve a IPv4 addresses (A records) for the hostname. The addresses argument passed to the callback function will contain an array of IPv4 addresses (e.g. ['74.125.79.104', '74.125.79.105','74.125.79.106']).

Parameters

hostname: string

Host name to resolve.

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

Parameters

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

Parameters

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

Parameters

hostname: string
options: unknown
optional
callback: unknown