dns API

Hint

The dns API is inherited from Firefox, and its primary documentation is maintained by Mozilla at MDN. Thunderbird implements only the subset of functions, events, and types listed here. The MDN pages may provide further details and examples, but they may also reference features that are not supported in Thunderbird.

Asynchronous DNS API

Permissions

The following permissions influence the behavior of the API. Depending on which permissions are requested, additional methods might be available, or certain data may be included in responses.

Hint

Request permissions only when needed. Unnecessary requests may result in rejection during ATN review.

dns

dns

Grant access to some or all methods of the dns API.

Note

The permission dns is required to use messenger.dns.*.

Functions

resolve(hostname, [flags])

– [Added in TB 60]

Resolves a hostname to a DNS record.

Parameters

hostname

hostname

(string)

flags

[flags]

(ResolveFlags, optional)

Required permissions

  • dns

Types

DNSRecord

An object encapsulating a DNS Record.

object

addresses

addresses

(array of string)

isTRR

isTRR

(string)

Record retreived with TRR.

canonicalName

[canonicalName]

(string, optional)

The canonical hostname for this record. this value is empty if the record was not fetched with the ‘canonical_name’ flag.

ResolveFlags

array of string

Supported values:

allow_name_collisions

bypass_cache

canonical_name

disable_ipv4

disable_ipv6

disable_trr

offline

priority_low

priority_medium

speculate