@dynatrace/runtime-simulator
Version:
The Dynatrace JavaScript runtime simulator.
636 lines (634 loc) • 38.4 kB
TypeScript
/**
* This module is not supported by the Dynatrace Javascript Runtime and only
* exists for its referenced types.
* See the `Node.js Compatibility` section for more information.
* @see https://dt-url.net/runtime-apis
*/
declare module 'dns' {
// DT-DISABLED // import * as dnsPromises from 'node:dns/promises';
// DT-DISABLED // // Supported getaddrinfo flags.
// DT-DISABLED // export const ADDRCONFIG: number;
// DT-DISABLED // export const V4MAPPED: number;
// DT-DISABLED // /**
// DT-DISABLED // * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as
// DT-DISABLED // * well as IPv4 mapped IPv6 addresses.
// DT-DISABLED // */
// DT-DISABLED // export const ALL: number;
export interface LookupOptions {
family?: number | undefined;
hints?: number | undefined;
all?: boolean | undefined;
/**
* @default true
*/
verbatim?: boolean | undefined;
}
export interface LookupOneOptions extends LookupOptions {
all?: false | undefined;
}
export interface LookupAllOptions extends LookupOptions {
all: true;
}
export interface LookupAddress {
address: string;
family: number;
}
// DT-DISABLED // /**
// DT-DISABLED // * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or
// DT-DISABLED // * AAAA (IPv6) record. All `option` properties are optional. If `options` is an
// DT-DISABLED // * integer, then it must be `4` or `6` – if `options` is `0` or not provided, then
// DT-DISABLED // * IPv4 and IPv6 addresses are both returned if found.
// DT-DISABLED // *
// DT-DISABLED // * With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the
// DT-DISABLED // * properties `address` and `family`.
// DT-DISABLED // *
// DT-DISABLED // * On error, `err` is an `Error` object, where `err.code` is the error code.
// DT-DISABLED // * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when
// DT-DISABLED // * the host name does not exist but also when the lookup fails in other ways
// DT-DISABLED // * such as no available file descriptors.
// DT-DISABLED // *
// DT-DISABLED // * `dns.lookup()` does not necessarily have anything to do with the DNS protocol.
// DT-DISABLED // * The implementation uses an operating system facility that can associate names
// DT-DISABLED // * with addresses and vice versa. This implementation can have subtle but
// DT-DISABLED // * important consequences on the behavior of any Node.js program. Please take some
// DT-DISABLED // * time to consult the `Implementation considerations section` before using`dns.lookup()`.
// DT-DISABLED // *
// DT-DISABLED // * Example usage:
// DT-DISABLED // *
// DT-DISABLED // * ```js
// DT-DISABLED // * const dns = require('node:dns');
// DT-DISABLED // * const options = {
// DT-DISABLED // * family: 6,
// DT-DISABLED // * hints: dns.ADDRCONFIG | dns.V4MAPPED,
// DT-DISABLED // * };
// DT-DISABLED // * dns.lookup('example.com', options, (err, address, family) =>
// DT-DISABLED // * console.log('address: %j family: IPv%s', address, family));
// DT-DISABLED // * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6
// DT-DISABLED // *
// DT-DISABLED // * // When options.all is true, the result will be an Array.
// DT-DISABLED // * options.all = true;
// DT-DISABLED // * dns.lookup('example.com', options, (err, addresses) =>
// DT-DISABLED // * console.log('addresses: %j', addresses));
// DT-DISABLED // * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}]
// DT-DISABLED // * ```
// DT-DISABLED // *
// DT-DISABLED // * If this method is invoked as its `util.promisify()` ed version, and `all`is not set to `true`, it returns a `Promise` for an `Object` with `address` and`family` properties.
// DT-DISABLED // * @since v0.1.90
// DT-DISABLED // */
// DT-DISABLED // export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
// DT-DISABLED // export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
// DT-DISABLED // export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void;
// DT-DISABLED // export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void;
// DT-DISABLED // export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
// DT-DISABLED // export namespace lookup {
// DT-DISABLED // function __promisify__(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
// DT-DISABLED // function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<LookupAddress>;
// DT-DISABLED // function __promisify__(hostname: string, options: LookupOptions): Promise<LookupAddress | LookupAddress[]>;
// DT-DISABLED // }
// DT-DISABLED // /**
// DT-DISABLED // * Resolves the given `address` and `port` into a host name and service using
// DT-DISABLED // * the operating system's underlying `getnameinfo` implementation.
// DT-DISABLED // *
// DT-DISABLED // * If `address` is not a valid IP address, a `TypeError` will be thrown.
// DT-DISABLED // * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown.
// DT-DISABLED // *
// DT-DISABLED // * On an error, `err` is an `Error` object, where `err.code` is the error code.
// DT-DISABLED // *
// DT-DISABLED // * ```js
// DT-DISABLED // * const dns = require('node:dns');
// DT-DISABLED // * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => {
// DT-DISABLED // * console.log(hostname, service);
// DT-DISABLED // * // Prints: localhost ssh
// DT-DISABLED // * });
// DT-DISABLED // * ```
// DT-DISABLED // *
// DT-DISABLED // * If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties.
// DT-DISABLED // * @since v0.11.14
// DT-DISABLED // */
// DT-DISABLED // export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void;
// DT-DISABLED // export namespace lookupService {
// DT-DISABLED // function __promisify__(
// DT-DISABLED // address: string,
// DT-DISABLED // port: number
// DT-DISABLED // ): Promise<{
// DT-DISABLED // hostname: string;
// DT-DISABLED // service: string;
// DT-DISABLED // }>;
// DT-DISABLED // }
// DT-DISABLED // export interface ResolveOptions {
// DT-DISABLED // ttl: boolean;
// DT-DISABLED // }
// DT-DISABLED // export interface ResolveWithTtlOptions extends ResolveOptions {
// DT-DISABLED // ttl: true;
// DT-DISABLED // }
// DT-DISABLED // export interface RecordWithTtl {
// DT-DISABLED // address: string;
// DT-DISABLED // ttl: number;
// DT-DISABLED // }
// DT-DISABLED // /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */
// DT-DISABLED // export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord;
// DT-DISABLED // export interface AnyARecord extends RecordWithTtl {
// DT-DISABLED // type: 'A';
// DT-DISABLED // }
// DT-DISABLED // export interface AnyAaaaRecord extends RecordWithTtl {
// DT-DISABLED // type: 'AAAA';
// DT-DISABLED // }
// DT-DISABLED // export interface CaaRecord {
// DT-DISABLED // critical: number;
// DT-DISABLED // issue?: string | undefined;
// DT-DISABLED // issuewild?: string | undefined;
// DT-DISABLED // iodef?: string | undefined;
// DT-DISABLED // contactemail?: string | undefined;
// DT-DISABLED // contactphone?: string | undefined;
// DT-DISABLED // }
// DT-DISABLED // export interface MxRecord {
// DT-DISABLED // priority: number;
// DT-DISABLED // exchange: string;
// DT-DISABLED // }
// DT-DISABLED // export interface AnyMxRecord extends MxRecord {
// DT-DISABLED // type: 'MX';
// DT-DISABLED // }
// DT-DISABLED // export interface NaptrRecord {
// DT-DISABLED // flags: string;
// DT-DISABLED // service: string;
// DT-DISABLED // regexp: string;
// DT-DISABLED // replacement: string;
// DT-DISABLED // order: number;
// DT-DISABLED // preference: number;
// DT-DISABLED // }
// DT-DISABLED // export interface AnyNaptrRecord extends NaptrRecord {
// DT-DISABLED // type: 'NAPTR';
// DT-DISABLED // }
// DT-DISABLED // export interface SoaRecord {
// DT-DISABLED // nsname: string;
// DT-DISABLED // hostmaster: string;
// DT-DISABLED // serial: number;
// DT-DISABLED // refresh: number;
// DT-DISABLED // retry: number;
// DT-DISABLED // expire: number;
// DT-DISABLED // minttl: number;
// DT-DISABLED // }
// DT-DISABLED // export interface AnySoaRecord extends SoaRecord {
// DT-DISABLED // type: 'SOA';
// DT-DISABLED // }
// DT-DISABLED // export interface SrvRecord {
// DT-DISABLED // priority: number;
// DT-DISABLED // weight: number;
// DT-DISABLED // port: number;
// DT-DISABLED // name: string;
// DT-DISABLED // }
// DT-DISABLED // export interface AnySrvRecord extends SrvRecord {
// DT-DISABLED // type: 'SRV';
// DT-DISABLED // }
// DT-DISABLED // export interface AnyTxtRecord {
// DT-DISABLED // type: 'TXT';
// DT-DISABLED // entries: string[];
// DT-DISABLED // }
// DT-DISABLED // export interface AnyNsRecord {
// DT-DISABLED // type: 'NS';
// DT-DISABLED // value: string;
// DT-DISABLED // }
// DT-DISABLED // export interface AnyPtrRecord {
// DT-DISABLED // type: 'PTR';
// DT-DISABLED // value: string;
// DT-DISABLED // }
// DT-DISABLED // export interface AnyCnameRecord {
// DT-DISABLED // type: 'CNAME';
// DT-DISABLED // value: string;
// DT-DISABLED // }
// DT-DISABLED // export type AnyRecord = AnyARecord | AnyAaaaRecord | AnyCnameRecord | AnyMxRecord | AnyNaptrRecord | AnyNsRecord | AnyPtrRecord | AnySoaRecord | AnySrvRecord | AnyTxtRecord;
// DT-DISABLED // /**
// DT-DISABLED // * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array
// DT-DISABLED // * of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource
// DT-DISABLED // * records. The type and structure of individual results varies based on `rrtype`:
// DT-DISABLED // *
// DT-DISABLED // * <omitted>
// DT-DISABLED // *
// DT-DISABLED // * On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`.
// DT-DISABLED // * @since v0.1.27
// DT-DISABLED // * @param hostname Host name to resolve.
// DT-DISABLED // * @param [rrtype='A'] Resource record type.
// DT-DISABLED // */
// DT-DISABLED // export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
// DT-DISABLED // export function resolve(hostname: string, rrtype: 'A', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
// DT-DISABLED // export function resolve(hostname: string, rrtype: 'AAAA', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
// DT-DISABLED // export function resolve(hostname: string, rrtype: 'ANY', callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
// DT-DISABLED // export function resolve(hostname: string, rrtype: 'CNAME', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
// DT-DISABLED // export function resolve(hostname: string, rrtype: 'MX', callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
// DT-DISABLED // export function resolve(hostname: string, rrtype: 'NAPTR', callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
// DT-DISABLED // export function resolve(hostname: string, rrtype: 'NS', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
// DT-DISABLED // export function resolve(hostname: string, rrtype: 'PTR', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
// DT-DISABLED // export function resolve(hostname: string, rrtype: 'SOA', callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void;
// DT-DISABLED // export function resolve(hostname: string, rrtype: 'SRV', callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
// DT-DISABLED // export function resolve(hostname: string, rrtype: 'TXT', callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
// DT-DISABLED // export function resolve(
// DT-DISABLED // hostname: string,
// DT-DISABLED // rrtype: string,
// DT-DISABLED // callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void
// DT-DISABLED // ): void;
// DT-DISABLED // export namespace resolve {
// DT-DISABLED // function __promisify__(hostname: string, rrtype?: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR'): Promise<string[]>;
// DT-DISABLED // function __promisify__(hostname: string, rrtype: 'ANY'): Promise<AnyRecord[]>;
// DT-DISABLED // function __promisify__(hostname: string, rrtype: 'MX'): Promise<MxRecord[]>;
// DT-DISABLED // function __promisify__(hostname: string, rrtype: 'NAPTR'): Promise<NaptrRecord[]>;
// DT-DISABLED // function __promisify__(hostname: string, rrtype: 'SOA'): Promise<SoaRecord>;
// DT-DISABLED // function __promisify__(hostname: string, rrtype: 'SRV'): Promise<SrvRecord[]>;
// DT-DISABLED // function __promisify__(hostname: string, rrtype: 'TXT'): Promise<string[][]>;
// DT-DISABLED // function __promisify__(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
// DT-DISABLED // }
// DT-DISABLED // /**
// DT-DISABLED // * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function
// DT-DISABLED // * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
// DT-DISABLED // * @since v0.1.16
// DT-DISABLED // * @param hostname Host name to resolve.
// DT-DISABLED // */
// DT-DISABLED // export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
// DT-DISABLED // export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
// DT-DISABLED // export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void;
// DT-DISABLED // export namespace resolve4 {
// DT-DISABLED // function __promisify__(hostname: string): Promise<string[]>;
// DT-DISABLED // function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
// DT-DISABLED // function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
// DT-DISABLED // }
// DT-DISABLED // /**
// DT-DISABLED // * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function
// DT-DISABLED // * will contain an array of IPv6 addresses.
// DT-DISABLED // * @since v0.1.16
// DT-DISABLED // * @param hostname Host name to resolve.
// DT-DISABLED // */
// DT-DISABLED // export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
// DT-DISABLED // export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
// DT-DISABLED // export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void;
// DT-DISABLED // export namespace resolve6 {
// DT-DISABLED // function __promisify__(hostname: string): Promise<string[]>;
// DT-DISABLED // function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
// DT-DISABLED // function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
// DT-DISABLED // }
// DT-DISABLED // /**
// DT-DISABLED // * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The`addresses` argument passed to the `callback` function
// DT-DISABLED // * will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`).
// DT-DISABLED // * @since v0.3.2
// DT-DISABLED // */
// DT-DISABLED // export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
// DT-DISABLED // export namespace resolveCname {
// DT-DISABLED // function __promisify__(hostname: string): Promise<string[]>;
// DT-DISABLED // }
// DT-DISABLED // /**
// DT-DISABLED // * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function
// DT-DISABLED // * will contain an array of certification authority authorization records
// DT-DISABLED // * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`).
// DT-DISABLED // * @since v15.0.0, v14.17.0
// DT-DISABLED // */
// DT-DISABLED // export function resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void;
// DT-DISABLED // export namespace resolveCaa {
// DT-DISABLED // function __promisify__(hostname: string): Promise<CaaRecord[]>;
// DT-DISABLED // }
// DT-DISABLED // /**
// DT-DISABLED // * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. The `addresses` argument passed to the `callback` function will
// DT-DISABLED // * contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`).
// DT-DISABLED // * @since v0.1.27
// DT-DISABLED // */
// DT-DISABLED // export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
// DT-DISABLED // export namespace resolveMx {
// DT-DISABLED // function __promisify__(hostname: string): Promise<MxRecord[]>;
// DT-DISABLED // }
// DT-DISABLED // /**
// DT-DISABLED // * Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. The `addresses` argument passed to the `callback`function will contain an array of
// DT-DISABLED // * objects with the following properties:
// DT-DISABLED // *
// DT-DISABLED // * * `flags`
// DT-DISABLED // * * `service`
// DT-DISABLED // * * `regexp`
// DT-DISABLED // * * `replacement`
// DT-DISABLED // * * `order`
// DT-DISABLED // * * `preference`
// DT-DISABLED // *
// DT-DISABLED // * ```js
// DT-DISABLED // * {
// DT-DISABLED // * flags: 's',
// DT-DISABLED // * service: 'SIP+D2U',
// DT-DISABLED // * regexp: '',
// DT-DISABLED // * replacement: '_sip._udp.example.com',
// DT-DISABLED // * order: 30,
// DT-DISABLED // * preference: 100
// DT-DISABLED // * }
// DT-DISABLED // * ```
// DT-DISABLED // * @since v0.9.12
// DT-DISABLED // */
// DT-DISABLED // export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
// DT-DISABLED // export namespace resolveNaptr {
// DT-DISABLED // function __promisify__(hostname: string): Promise<NaptrRecord[]>;
// DT-DISABLED // }
// DT-DISABLED // /**
// DT-DISABLED // * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. The `addresses` argument passed to the `callback` function will
// DT-DISABLED // * contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`).
// DT-DISABLED // * @since v0.1.90
// DT-DISABLED // */
// DT-DISABLED // export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
// DT-DISABLED // export namespace resolveNs {
// DT-DISABLED // function __promisify__(hostname: string): Promise<string[]>;
// DT-DISABLED // }
// DT-DISABLED // /**
// DT-DISABLED // * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. The `addresses` argument passed to the `callback` function will
// DT-DISABLED // * be an array of strings containing the reply records.
// DT-DISABLED // * @since v6.0.0
// DT-DISABLED // */
// DT-DISABLED // export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
// DT-DISABLED // export namespace resolvePtr {
// DT-DISABLED // function __promisify__(hostname: string): Promise<string[]>;
// DT-DISABLED // }
// DT-DISABLED // /**
// DT-DISABLED // * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for
// DT-DISABLED // * the `hostname`. The `address` argument passed to the `callback` function will
// DT-DISABLED // * be an object with the following properties:
// DT-DISABLED // *
// DT-DISABLED // * * `nsname`
// DT-DISABLED // * * `hostmaster`
// DT-DISABLED // * * `serial`
// DT-DISABLED // * * `refresh`
// DT-DISABLED // * * `retry`
// DT-DISABLED // * * `expire`
// DT-DISABLED // * * `minttl`
// DT-DISABLED // *
// DT-DISABLED // * ```js
// DT-DISABLED // * {
// DT-DISABLED // * nsname: 'ns.example.com',
// DT-DISABLED // * hostmaster: 'root.example.com',
// DT-DISABLED // * serial: 2013101809,
// DT-DISABLED // * refresh: 10000,
// DT-DISABLED // * retry: 2400,
// DT-DISABLED // * expire: 604800,
// DT-DISABLED // * minttl: 3600
// DT-DISABLED // * }
// DT-DISABLED // * ```
// DT-DISABLED // * @since v0.11.10
// DT-DISABLED // */
// DT-DISABLED // export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void;
// DT-DISABLED // export namespace resolveSoa {
// DT-DISABLED // function __promisify__(hostname: string): Promise<SoaRecord>;
// DT-DISABLED // }
// DT-DISABLED // /**
// DT-DISABLED // * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. The `addresses` argument passed to the `callback` function will
// DT-DISABLED // * be an array of objects with the following properties:
// DT-DISABLED // *
// DT-DISABLED // * * `priority`
// DT-DISABLED // * * `weight`
// DT-DISABLED // * * `port`
// DT-DISABLED // * * `name`
// DT-DISABLED // *
// DT-DISABLED // * ```js
// DT-DISABLED // * {
// DT-DISABLED // * priority: 10,
// DT-DISABLED // * weight: 5,
// DT-DISABLED // * port: 21223,
// DT-DISABLED // * name: 'service.example.com'
// DT-DISABLED // * }
// DT-DISABLED // * ```
// DT-DISABLED // * @since v0.1.27
// DT-DISABLED // */
// DT-DISABLED // export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
// DT-DISABLED // export namespace resolveSrv {
// DT-DISABLED // function __promisify__(hostname: string): Promise<SrvRecord[]>;
// DT-DISABLED // }
// DT-DISABLED // /**
// DT-DISABLED // * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. The `records` argument passed to the `callback` function is a
// DT-DISABLED // * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
// DT-DISABLED // * one record. Depending on the use case, these could be either joined together or
// DT-DISABLED // * treated separately.
// DT-DISABLED // * @since v0.1.27
// DT-DISABLED // */
// DT-DISABLED // export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
// DT-DISABLED // export namespace resolveTxt {
// DT-DISABLED // function __promisify__(hostname: string): Promise<string[][]>;
// DT-DISABLED // }
// DT-DISABLED // /**
// DT-DISABLED // * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query).
// DT-DISABLED // * The `ret` argument passed to the `callback` function will be an array containing
// DT-DISABLED // * various types of records. Each object has a property `type` that indicates the
// DT-DISABLED // * type of the current record. And depending on the `type`, additional properties
// DT-DISABLED // * will be present on the object:
// DT-DISABLED // *
// DT-DISABLED // * <omitted>
// DT-DISABLED // *
// DT-DISABLED // * Here is an example of the `ret` object passed to the callback:
// DT-DISABLED // *
// DT-DISABLED // * ```js
// DT-DISABLED // * [ { type: 'A', address: '127.0.0.1', ttl: 299 },
// DT-DISABLED // * { type: 'CNAME', value: 'example.com' },
// DT-DISABLED // * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 },
// DT-DISABLED // * { type: 'NS', value: 'ns1.example.com' },
// DT-DISABLED // * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] },
// DT-DISABLED // * { type: 'SOA',
// DT-DISABLED // * nsname: 'ns1.example.com',
// DT-DISABLED // * hostmaster: 'admin.example.com',
// DT-DISABLED // * serial: 156696742,
// DT-DISABLED // * refresh: 900,
// DT-DISABLED // * retry: 900,
// DT-DISABLED // * expire: 1800,
// DT-DISABLED // * minttl: 60 } ]
// DT-DISABLED // * ```
// DT-DISABLED // *
// DT-DISABLED // * DNS server operators may choose not to respond to `ANY`queries. It may be better to call individual methods like {@link resolve4},{@link resolveMx}, and so on. For more details, see [RFC
// DT-DISABLED // * 8482](https://tools.ietf.org/html/rfc8482).
// DT-DISABLED // */
// DT-DISABLED // export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
// DT-DISABLED // export namespace resolveAny {
// DT-DISABLED // function __promisify__(hostname: string): Promise<AnyRecord[]>;
// DT-DISABLED // }
// DT-DISABLED // /**
// DT-DISABLED // * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
// DT-DISABLED // * array of host names.
// DT-DISABLED // *
// DT-DISABLED // * On error, `err` is an `Error` object, where `err.code` is
// DT-DISABLED // * one of the `DNS error codes`.
// DT-DISABLED // * @since v0.1.16
// DT-DISABLED // */
// DT-DISABLED // export function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void;
// DT-DISABLED // /**
// DT-DISABLED // * Get the default value for `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be:
// DT-DISABLED // *
// DT-DISABLED // * * `ipv4first`: for `verbatim` defaulting to `false`.
// DT-DISABLED // * * `verbatim`: for `verbatim` defaulting to `true`.
// DT-DISABLED // * @since v20.1.0
// DT-DISABLED // */
// DT-DISABLED // export function getDefaultResultOrder(): 'ipv4first' | 'verbatim';
// DT-DISABLED // /**
// DT-DISABLED // * Sets the IP address and port of servers to be used when performing DNS
// DT-DISABLED // * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted
// DT-DISABLED // * addresses. If the port is the IANA default DNS port (53) it can be omitted.
// DT-DISABLED // *
// DT-DISABLED // * ```js
// DT-DISABLED // * dns.setServers([
// DT-DISABLED // * '4.4.4.4',
// DT-DISABLED // * '[2001:4860:4860::8888]',
// DT-DISABLED // * '4.4.4.4:1053',
// DT-DISABLED // * '[2001:4860:4860::8888]:1053',
// DT-DISABLED // * ]);
// DT-DISABLED // * ```
// DT-DISABLED // *
// DT-DISABLED // * An error will be thrown if an invalid address is provided.
// DT-DISABLED // *
// DT-DISABLED // * The `dns.setServers()` method must not be called while a DNS query is in
// DT-DISABLED // * progress.
// DT-DISABLED // *
// DT-DISABLED // * The {@link setServers} method affects only {@link resolve},`dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}).
// DT-DISABLED // *
// DT-DISABLED // * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html).
// DT-DISABLED // * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with
// DT-DISABLED // * subsequent servers provided. Fallback DNS servers will only be used if the
// DT-DISABLED // * earlier ones time out or result in some other error.
// DT-DISABLED // * @since v0.11.3
// DT-DISABLED // * @param servers array of `RFC 5952` formatted addresses
// DT-DISABLED // */
// DT-DISABLED // export function setServers(servers: ReadonlyArray<string>): void;
// DT-DISABLED // /**
// DT-DISABLED // * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6),
// DT-DISABLED // * that are currently configured for DNS resolution. A string will include a port
// DT-DISABLED // * section if a custom port is used.
// DT-DISABLED // *
// DT-DISABLED // * ```js
// DT-DISABLED // * [
// DT-DISABLED // * '4.4.4.4',
// DT-DISABLED // * '2001:4860:4860::8888',
// DT-DISABLED // * '4.4.4.4:1053',
// DT-DISABLED // * '[2001:4860:4860::8888]:1053',
// DT-DISABLED // * ]
// DT-DISABLED // * ```
// DT-DISABLED // * @since v0.11.3
// DT-DISABLED // */
// DT-DISABLED // export function getServers(): string[];
// DT-DISABLED // /**
// DT-DISABLED // * Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be:
// DT-DISABLED // *
// DT-DISABLED // * * `ipv4first`: sets default `verbatim` `false`.
// DT-DISABLED // * * `verbatim`: sets default `verbatim` `true`.
// DT-DISABLED // *
// DT-DISABLED // * The default is `verbatim` and {@link setDefaultResultOrder} have higher
// DT-DISABLED // * priority than `--dns-result-order`. When using `worker threads`,{@link setDefaultResultOrder} from the main thread won't affect the default
// DT-DISABLED // * dns orders in workers.
// DT-DISABLED // * @since v16.4.0, v14.18.0
// DT-DISABLED // * @param order must be `'ipv4first'` or `'verbatim'`.
// DT-DISABLED // */
// DT-DISABLED // export function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void;
// DT-DISABLED // // Error codes
// DT-DISABLED // export const NODATA: string;
// DT-DISABLED // export const FORMERR: string;
// DT-DISABLED // export const SERVFAIL: string;
// DT-DISABLED // export const NOTFOUND: string;
// DT-DISABLED // export const NOTIMP: string;
// DT-DISABLED // export const REFUSED: string;
// DT-DISABLED // export const BADQUERY: string;
// DT-DISABLED // export const BADNAME: string;
// DT-DISABLED // export const BADFAMILY: string;
// DT-DISABLED // export const BADRESP: string;
// DT-DISABLED // export const CONNREFUSED: string;
// DT-DISABLED // export const TIMEOUT: string;
// DT-DISABLED // export const EOF: string;
// DT-DISABLED // export const FILE: string;
// DT-DISABLED // export const NOMEM: string;
// DT-DISABLED // export const DESTRUCTION: string;
// DT-DISABLED // export const BADSTR: string;
// DT-DISABLED // export const BADFLAGS: string;
// DT-DISABLED // export const NONAME: string;
// DT-DISABLED // export const BADHINTS: string;
// DT-DISABLED // export const NOTINITIALIZED: string;
// DT-DISABLED // export const LOADIPHLPAPI: string;
// DT-DISABLED // export const ADDRGETNETWORKPARAMS: string;
// DT-DISABLED // export const CANCELLED: string;
// DT-DISABLED // export interface ResolverOptions {
// DT-DISABLED // timeout?: number | undefined;
// DT-DISABLED // /**
// DT-DISABLED // * @default 4
// DT-DISABLED // */
// DT-DISABLED // tries?: number;
// DT-DISABLED // }
// DT-DISABLED // /**
// DT-DISABLED // * An independent resolver for DNS requests.
// DT-DISABLED // *
// DT-DISABLED // * Creating a new resolver uses the default server settings. Setting
// DT-DISABLED // * the servers used for a resolver using `resolver.setServers()` does not affect
// DT-DISABLED // * other resolvers:
// DT-DISABLED // *
// DT-DISABLED // * ```js
// DT-DISABLED // * const { Resolver } = require('node:dns');
// DT-DISABLED // * const resolver = new Resolver();
// DT-DISABLED // * resolver.setServers(['4.4.4.4']);
// DT-DISABLED // *
// DT-DISABLED // * // This request will use the server at 4.4.4.4, independent of global settings.
// DT-DISABLED // * resolver.resolve4('example.org', (err, addresses) => {
// DT-DISABLED // * // ...
// DT-DISABLED // * });
// DT-DISABLED // * ```
// DT-DISABLED // *
// DT-DISABLED // * The following methods from the `node:dns` module are available:
// DT-DISABLED // *
// DT-DISABLED // * * `resolver.getServers()`
// DT-DISABLED // * * `resolver.resolve()`
// DT-DISABLED // * * `resolver.resolve4()`
// DT-DISABLED // * * `resolver.resolve6()`
// DT-DISABLED // * * `resolver.resolveAny()`
// DT-DISABLED // * * `resolver.resolveCaa()`
// DT-DISABLED // * * `resolver.resolveCname()`
// DT-DISABLED // * * `resolver.resolveMx()`
// DT-DISABLED // * * `resolver.resolveNaptr()`
// DT-DISABLED // * * `resolver.resolveNs()`
// DT-DISABLED // * * `resolver.resolvePtr()`
// DT-DISABLED // * * `resolver.resolveSoa()`
// DT-DISABLED // * * `resolver.resolveSrv()`
// DT-DISABLED // * * `resolver.resolveTxt()`
// DT-DISABLED // * * `resolver.reverse()`
// DT-DISABLED // * * `resolver.setServers()`
// DT-DISABLED // * @since v8.3.0
// DT-DISABLED // */
// DT-DISABLED // export class Resolver {
// DT-DISABLED // constructor(options?: ResolverOptions);
// DT-DISABLED // /**
// DT-DISABLED // * Cancel all outstanding DNS queries made by this resolver. The corresponding
// DT-DISABLED // * callbacks will be called with an error with code `ECANCELLED`.
// DT-DISABLED // * @since v8.3.0
// DT-DISABLED // */
// DT-DISABLED // cancel(): void;
// DT-DISABLED // getServers: typeof getServers;
// DT-DISABLED // resolve: typeof resolve;
// DT-DISABLED // resolve4: typeof resolve4;
// DT-DISABLED // resolve6: typeof resolve6;
// DT-DISABLED // resolveAny: typeof resolveAny;
// DT-DISABLED // resolveCaa: typeof resolveCaa;
// DT-DISABLED // resolveCname: typeof resolveCname;
// DT-DISABLED // resolveMx: typeof resolveMx;
// DT-DISABLED // resolveNaptr: typeof resolveNaptr;
// DT-DISABLED // resolveNs: typeof resolveNs;
// DT-DISABLED // resolvePtr: typeof resolvePtr;
// DT-DISABLED // resolveSoa: typeof resolveSoa;
// DT-DISABLED // resolveSrv: typeof resolveSrv;
// DT-DISABLED // resolveTxt: typeof resolveTxt;
// DT-DISABLED // reverse: typeof reverse;
// DT-DISABLED // /**
// DT-DISABLED // * The resolver instance will send its requests from the specified IP address.
// DT-DISABLED // * This allows programs to specify outbound interfaces when used on multi-homed
// DT-DISABLED // * systems.
// DT-DISABLED // *
// DT-DISABLED // * If a v4 or v6 address is not specified, it is set to the default and the
// DT-DISABLED // * operating system will choose a local address automatically.
// DT-DISABLED // *
// DT-DISABLED // * The resolver will use the v4 local address when making requests to IPv4 DNS
// DT-DISABLED // * servers, and the v6 local address when making requests to IPv6 DNS servers.
// DT-DISABLED // * The `rrtype` of resolution requests has no impact on the local address used.
// DT-DISABLED // * @since v15.1.0, v14.17.0
// DT-DISABLED // * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address.
// DT-DISABLED // * @param [ipv6='::0'] A string representation of an IPv6 address.
// DT-DISABLED // */
// DT-DISABLED // setLocalAddress(ipv4?: string, ipv6?: string): void;
// DT-DISABLED // setServers: typeof setServers;
// DT-DISABLED // }
// DT-DISABLED // export { dnsPromises as promises };
}
/**
* This module is not supported by the Dynatrace Javascript Runtime and only
* exists for its referenced types.
* See the `Node.js Compatibility` section for more information.
* @see https://dt-url.net/runtime-apis
*/
declare module 'node:dns' {
export * from 'dns';
}