Skip to content

DNS over UDP

DNS over UDP uses the traditional DNS protocol over UDP for hostname resolution.

import DNSServer from "embedded:network/dns-over-udp";

Creates a new DNS over UDP server object instance.

DNSServer(options)

options

address - A string representing the DNS server IP address.

port - The DNS server port number.

Closes the DNS server.

close()

Resolves a hostname to an IP address.

resolve(options, callback)

options

host - A string containing the hostname to resolve.

callback

callback(error, name, address)

error - An Error object if the operation failed, or null if successful.

name - The hostname that was resolved.

address - The resolved IP address as a string.

DNS over UDP