Skip to main content
resolveCname - dns - Node documentation
function resolveCname

Usage in Deno

import { resolveCname } from "node:dns";
resolveCname(
hostname: string,
callback: (
err: ErrnoException | null,
addresses: string[],
) => void
,
): void

Deno compatibility

The ttl option is not supported.

Uses the DNS protocol to resolve CNAME records for the hostname. The addresses argument passed to the callback function will contain an array of canonical name records available for the hostname (e.g. ['bar.example.com']).

Parameters

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

Return Type

void