DnsRecord
DNS Record object representing a single DNS record with type, TTL, and value.Fields
Fully qualified domain name (FQDN).Examples:
example.com, mail.google.com, analytics.x.comRecord type: A, AAAA, CNAME, MX, TXT, etc.See DnsRecordType for all supported types.
Time to live (in seconds) for this record.This indicates how long the record should be cached by DNS resolvers.
Record data. The format depends on the record type:
- A: IPv4 address (e.g.,
93.184.216.34) - AAAA: IPv6 address (e.g.,
2606:2800:220:1:248:1893:25c8:1946) - CNAME: Target FQDN (e.g.,
example.com) - MX: Priority and mail server (e.g.,
10 mail.example.com) - TXT: Text content (e.g.,
v=spf1 include:_spf.example.com ~all) - NS: Nameserver FQDN (e.g.,
ns1.example.com) - SOA: Start of authority data
- SRV: Service location data
- CAA: Certificate authority authorization
Example
DnsRecordType
The type of a DNS record.Supported record types
IPv4 address record. Maps a domain name to an IPv4 address.
IPv6 address record. Maps a domain name to an IPv6 address.
Canonical name record. Creates an alias from one domain name to another.
Mail exchange record. Specifies mail servers for the domain.
Text record. Holds arbitrary text data, often used for verification and configuration.
Nameserver record. Specifies authoritative nameservers for the domain.
Start of authority record. Contains administrative information about the DNS zone.
Pointer record. Used for reverse DNS lookups.
Service record. Defines location of services.
Certificate authority authorization record. Specifies which CAs can issue certificates.
Naming authority pointer record. Used for ENUM and other applications.
Delegation signer record. Used in DNSSEC.
DNS public key record. Used in DNSSEC.
Signature record. Used in DNSSEC (legacy).
Public key record (legacy).
GetAllDnsRecordsOptions
Options for discovering DNS records withgetAllDnsRecords and getAllDnsRecordsStream.
Fields
Which DNS resolver to use for DNS lookup.Options:
cloudflare-dns- Cloudflare DNS over HTTPS (best for Cloudflare Workers)google-dns- Google DNS over HTTPS (best for browsers and Deno)node-dns- Node.js built-in DNS resolver (best for Node.js)node-dig- Node.jsdigcommand wrapperdeno-dns- Deno DNS resolver (not yet implemented)
Check for common subdomains from the built-in list.When enabled (default), the library will check a predefined list of common subdomains like
www, mail, api, dev, staging, etc.Set to false to disable common subdomain checking and only query the base domain.List of extra subdomains to check for beyond the built-in common subdomains list.Example:
['api', 'staging', 'dev', 'internal']These subdomains will be checked in addition to the common subdomains (if commonSubdomainsCheck is enabled).