| | |
| | | * ``` |
| | | * |
| | | * See the `Implementation considerations section` for more information. |
| | | * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/dns.js) |
| | | * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/dns.js) |
| | | */ |
| | | declare module 'dns' { |
| | | import * as dnsPromises from 'node:dns/promises'; |
| | |
| | | family?: number | undefined; |
| | | hints?: number | undefined; |
| | | all?: boolean | undefined; |
| | | /** |
| | | * @default true |
| | | */ |
| | | verbatim?: boolean | undefined; |
| | | } |
| | | export interface LookupOneOptions extends LookupOptions { |
| | |
| | | * |
| | | * <omitted> |
| | | * |
| | | * On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`. |
| | | * On error, `err` is an `Error` object, where `err.code` is one of theDNS error codes. |
| | | * @since v0.1.27 |
| | | * @param hostname Host name to resolve. |
| | | * @param [rrtype='A'] Resource record type. |
| | |
| | | * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function |
| | | * will contain an array of certification authority authorization records |
| | | * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). |
| | | * @since v15.0.0 |
| | | * @since v15.0.0, v14.17.0 |
| | | */ |
| | | export function resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void; |
| | | export namespace resolveCaa { |
| | |
| | | * @since v0.11.3 |
| | | */ |
| | | export function getServers(): string[]; |
| | | /** |
| | | * Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: |
| | | * |
| | | * * `ipv4first`: sets default `verbatim` `false`. |
| | | * * `verbatim`: sets default `verbatim` `true`. |
| | | * |
| | | * The default is `ipv4first` and {@link setDefaultResultOrder} have higher |
| | | * priority than `--dns-result-order`. When using `worker threads`,{@link setDefaultResultOrder} from the main thread won't affect the default |
| | | * dns orders in workers. |
| | | * @since v16.4.0, v14.18.0 |
| | | * @param order must be `'ipv4first'` or `'verbatim'`. |
| | | */ |
| | | export function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void; |
| | | // Error codes |
| | | export const NODATA: string; |
| | | export const FORMERR: string; |
| | |
| | | * The resolver will use the v4 local address when making requests to IPv4 DNS |
| | | * servers, and the v6 local address when making requests to IPv6 DNS servers. |
| | | * The `rrtype` of resolution requests has no impact on the local address used. |
| | | * @since v15.1.0 |
| | | * @since v15.1.0, v14.17.0 |
| | | * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. |
| | | * @param [ipv6='::0'] A string representation of an IPv6 address. |
| | | */ |