Skip to content

dns

You can use node:dns for name resolution via DNS over HTTPS using Cloudflare DNS at 1.1.1.1.

index.js
import dns from "node:dns";
let responese = await dns.promises.resolve4("cloudflare.com", "NS");

All node:dns functions are available, except lookup, lookupService, and resolve which throw "Not implemented" errors when called.

The full node:dns API is documented in the Node.js documentation for node:dns.