Skip to content

dns ​

The dns helper allows DNS lookups.

Method ​

dns.lookup(domain: string) ​

Performs a doman lookup.

It will try to get the record for CNAME, if empty then A, if empty then AAAA else returns an empty string.

js
const ip = dns.lookup("google.com")

dns.lookup(domain: string, type: string) ​

Performs a doman lookup for a specific record type and returns a list of all records.

If not found, it will return an empty string.

js
const ip = dns.lookup("google.com","TXT")