Global

Type Definitions

DOH_LookupOptions

Options for doing DOH lookups.
Properties:
Name Type Attributes Default Description
name string <optional>
The DNS name to look up.
rrtype string <optional>
'A' The Resource Record type to retrive.
json boolean <optional>
true Retrieve a JSON response. If false, retrieve using DNS format.
decode boolean <optional>
true Decode the response, either into JSON or an object representing the DNS format result.
preferPost boolean <optional>
true For DNS format requests, should the HTTP POST verb be used? If false, uses GET.
dnssec boolean <optional>
false Request DNSSec records. Currently requires `json: false`.
url string <optional>
CLOUDFLARE_API What DoH endpoint should be used?
Source:
Type:
  • object

DOT_LookupOptions

Options for doing DOT lookups.
Properties:
Name Type Attributes Default Description
name string <optional>
The DNS name to look up.
rrtype string <optional>
'A' The Resource Record type to retrive.
id number <optional>
2-byte ID for the DNS packet. Defaults to random.
decode boolean <optional>
true Decode the response, either into JSON or an object representing the DNS format result.
dnssec boolean <optional>
false Request DNSSec records. Currently requires `json: false`.
Source:
Type:
  • object

LookupOptions

Properties:
Name Type Attributes Default Description
name string <optional>
Name to look up.
rrtype string <optional>
The Resource Record type to retrive.
id number <optional>
The 2-byte unsigned integer for the request. For DOH, should be 0 or undefined.
json boolean <optional>
Force JSON lookups for DOH. Ignored for DOT.
stream boolean <optional>
false Encode for streaming, with the packet prefixed by a 2-byte big-endian integer of the number of bytes in the packet.
Source:
Type:
  • object

Pending

Properties:
Name Type Description
resolve pendingResolve Callback for success.
reject pendingError Callback for error.
opts DOT_LookupOptions The original options for the request.
Source:
Type:
  • object

pendingError(error)

Source:
Parameters:
Name Type Description
error Error The error that occurred.

pendingResolve(results)

Source:
Parameters:
Name Type Description
results Buffer | object The results of the DNS query.