{
  "type": "module",
  "source": "doc/api/dns.md",
  "modules": [
    {
      "textRaw": "DNS",
      "name": "dns",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:dns</code> module enables name resolution. For example, use it to look up IP\naddresses of host names.</p>\n<p>Although named for the <a href=\"https://en.wikipedia.org/wiki/Domain_Name_System\">Domain Name System (DNS)</a>, it does not always use the\nDNS protocol for lookups. <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> uses the operating system\nfacilities to perform name resolution. It may not need to perform any network\ncommunication. To perform name resolution the way other applications on the same\nsystem do, use <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a>.</p>\n<pre><code class=\"language-mjs\">import dns from 'node:dns';\n\ndns.lookup('example.org', (err, address, family) => {\n  console.log('address: %j family: IPv%s', address, family);\n});\n// address: \"2606:2800:21f:cb07:6820:80da:af6b:8b2c\" family: IPv6\n</code></pre>\n<pre><code class=\"language-cjs\">const dns = require('node:dns');\n\ndns.lookup('example.org', (err, address, family) => {\n  console.log('address: %j family: IPv%s', address, family);\n});\n// address: \"2606:2800:21f:cb07:6820:80da:af6b:8b2c\" family: IPv6\n</code></pre>\n<p>All other functions in the <code>node:dns</code> module connect to an actual DNS server to\nperform name resolution. They will always use the network to perform DNS\nqueries. These functions do not use the same set of configuration files used by\n<a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> (e.g. <code>/etc/hosts</code>). Use these functions to always perform\nDNS queries, bypassing other name-resolution facilities.</p>\n<pre><code class=\"language-mjs\">import dns from 'node:dns';\n\ndns.resolve4('archive.org', (err, addresses) => {\n  if (err) throw err;\n\n  console.log(`addresses: ${JSON.stringify(addresses)}`);\n\n  addresses.forEach((a) => {\n    dns.reverse(a, (err, hostnames) => {\n      if (err) {\n        throw err;\n      }\n      console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`);\n    });\n  });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const dns = require('node:dns');\n\ndns.resolve4('archive.org', (err, addresses) => {\n  if (err) throw err;\n\n  console.log(`addresses: ${JSON.stringify(addresses)}`);\n\n  addresses.forEach((a) => {\n    dns.reverse(a, (err, hostnames) => {\n      if (err) {\n        throw err;\n      }\n      console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`);\n    });\n  });\n});\n</code></pre>\n<p>See the <a href=\"#implementation-considerations\">Implementation considerations section</a> for more information.</p>",
      "classes": [
        {
          "textRaw": "Class: `dns.Resolver`",
          "name": "dns.Resolver",
          "type": "class",
          "meta": {
            "added": [
              "v8.3.0"
            ],
            "changes": []
          },
          "desc": "<p>An independent resolver for DNS requests.</p>\n<p>Creating a new resolver uses the default server settings. Setting\nthe servers used for a resolver using\n<a href=\"#dnssetserversservers\"><code>resolver.setServers()</code></a> does not affect\nother resolvers:</p>\n<pre><code class=\"language-mjs\">import { Resolver } from 'node:dns';\nconst resolver = new Resolver();\nresolver.setServers(['4.4.4.4']);\n\n// This request will use the server at 4.4.4.4, independent of global settings.\nresolver.resolve4('example.org', (err, addresses) => {\n  // ...\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { Resolver } = require('node:dns');\nconst resolver = new Resolver();\nresolver.setServers(['4.4.4.4']);\n\n// This request will use the server at 4.4.4.4, independent of global settings.\nresolver.resolve4('example.org', (err, addresses) => {\n  // ...\n});\n</code></pre>\n<p>The following methods from the <code>node:dns</code> module are available:</p>\n<ul>\n<li><a href=\"#dnsgetservers\"><code>resolver.getServers()</code></a></li>\n<li><a href=\"#dnsresolvehostname-rrtype-callback\"><code>resolver.resolve()</code></a></li>\n<li><a href=\"#dnsresolve4hostname-options-callback\"><code>resolver.resolve4()</code></a></li>\n<li><a href=\"#dnsresolve6hostname-options-callback\"><code>resolver.resolve6()</code></a></li>\n<li><a href=\"#dnsresolveanyhostname-callback\"><code>resolver.resolveAny()</code></a></li>\n<li><a href=\"#dnsresolvecaahostname-callback\"><code>resolver.resolveCaa()</code></a></li>\n<li><a href=\"#dnsresolvecnamehostname-callback\"><code>resolver.resolveCname()</code></a></li>\n<li><a href=\"#dnsresolvemxhostname-callback\"><code>resolver.resolveMx()</code></a></li>\n<li><a href=\"#dnsresolvenaptrhostname-callback\"><code>resolver.resolveNaptr()</code></a></li>\n<li><a href=\"#dnsresolvenshostname-callback\"><code>resolver.resolveNs()</code></a></li>\n<li><a href=\"#dnsresolveptrhostname-callback\"><code>resolver.resolvePtr()</code></a></li>\n<li><a href=\"#dnsresolvesoahostname-callback\"><code>resolver.resolveSoa()</code></a></li>\n<li><a href=\"#dnsresolvesrvhostname-callback\"><code>resolver.resolveSrv()</code></a></li>\n<li><a href=\"#dnsresolvetlsahostname-callback\"><code>resolver.resolveTlsa()</code></a></li>\n<li><a href=\"#dnsresolvetxthostname-callback\"><code>resolver.resolveTxt()</code></a></li>\n<li><a href=\"#dnsreverseip-callback\"><code>resolver.reverse()</code></a></li>\n<li><a href=\"#dnssetserversservers\"><code>resolver.setServers()</code></a></li>\n</ul>",
          "methods": [
            {
              "textRaw": "`Resolver([options])`",
              "name": "Resolver",
              "type": "method",
              "meta": {
                "added": [
                  "v8.3.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v16.7.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/39610",
                    "description": "The `options` object now accepts a `tries` option."
                  },
                  {
                    "version": "v12.18.3",
                    "pr-url": "https://github.com/nodejs/node/pull/33472",
                    "description": "The constructor now accepts an `options` object. The single supported option is `timeout`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`timeout` {integer} Query timeout in milliseconds, or `-1` to use the default timeout.",
                          "name": "timeout",
                          "type": "integer",
                          "desc": "Query timeout in milliseconds, or `-1` to use the default timeout."
                        },
                        {
                          "textRaw": "`tries` {integer} The number of tries the resolver will try contacting each name server before giving up. **Default:** `4`",
                          "name": "tries",
                          "type": "integer",
                          "default": "`4`",
                          "desc": "The number of tries the resolver will try contacting each name server before giving up."
                        },
                        {
                          "textRaw": "`maxTimeout` {integer} The max retry timeout, in milliseconds. **Default:** `0`, disabled.",
                          "name": "maxTimeout",
                          "type": "integer",
                          "default": "`0`, disabled",
                          "desc": "The max retry timeout, in milliseconds."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Create a new resolver.</p>"
            },
            {
              "textRaw": "`resolver.cancel()`",
              "name": "cancel",
              "type": "method",
              "meta": {
                "added": [
                  "v8.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Cancel all outstanding DNS queries made by this resolver. The corresponding\ncallbacks will be called with an error with code <code>ECANCELLED</code>.</p>"
            },
            {
              "textRaw": "`resolver.setLocalAddress([ipv4][, ipv6])`",
              "name": "setLocalAddress",
              "type": "method",
              "meta": {
                "added": [
                  "v15.1.0",
                  "v14.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`ipv4` {string} A string representation of an IPv4 address. **Default:** `'0.0.0.0'`",
                      "name": "ipv4",
                      "type": "string",
                      "default": "`'0.0.0.0'`",
                      "desc": "A string representation of an IPv4 address.",
                      "optional": true
                    },
                    {
                      "textRaw": "`ipv6` {string} A string representation of an IPv6 address. **Default:** `'::0'`",
                      "name": "ipv6",
                      "type": "string",
                      "default": "`'::0'`",
                      "desc": "A string representation of an IPv6 address.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>The resolver instance will send its requests from the specified IP address.\nThis allows programs to specify outbound interfaces when used on multi-homed\nsystems.</p>\n<p>If a v4 or v6 address is not specified, it is set to the default and the\noperating system will choose a local address automatically.</p>\n<p>The resolver will use the v4 local address when making requests to IPv4 DNS\nservers, and the v6 local address when making requests to IPv6 DNS servers.\nThe <code>rrtype</code> of resolution requests has no impact on the local address used.</p>"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`dns.getServers()`",
          "name": "getServers",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {string[]}",
                "name": "return",
                "type": "string[]"
              }
            }
          ],
          "desc": "<p>Returns an array of IP address strings, formatted according to <a href=\"https://tools.ietf.org/html/rfc5952#section-6\">RFC 5952</a>,\nthat are currently configured for DNS resolution. A string will include a port\nsection if a custom port is used.</p>\n<pre><code class=\"language-js\">[\n  '8.8.8.8',\n  '2001:4860:4860::8888',\n  '8.8.8.8:1053',\n  '[2001:4860:4860::8888]:1053',\n]\n</code></pre>"
        },
        {
          "textRaw": "`dns.lookup(hostname[, options], callback)`",
          "name": "lookup",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.90"
            ],
            "changes": [
              {
                "version": [
                  "v22.1.0",
                  "v20.13.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/52492",
                "description": "The `verbatim` option is now deprecated in favor of the new `order` option."
              },
              {
                "version": "v18.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/43054",
                "description": "For compatibility with `node:net`, when passing an option object the `family` option can be the string `'IPv4'` or the string `'IPv6'`."
              },
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              },
              {
                "version": "v17.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/39987",
                "description": "The `verbatim` options defaults to `true` now."
              },
              {
                "version": "v8.5.0",
                "pr-url": "https://github.com/nodejs/node/pull/14731",
                "description": "The `verbatim` option is supported now."
              },
              {
                "version": "v1.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/744",
                "description": "The `all` option is supported now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`options` {integer|Object}",
                  "name": "options",
                  "type": "integer|Object",
                  "options": [
                    {
                      "textRaw": "`family` {integer|string} The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons,`'IPv4'` and `'IPv6'` are interpreted as `4` and `6` respectively. The value `0` indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used with `{ all: true }` (see below), either one of or both IPv4 and IPv6 addresses are returned, depending on the system's DNS resolver. **Default:** `0`.",
                      "name": "family",
                      "type": "integer|string",
                      "default": "`0`",
                      "desc": "The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons,`'IPv4'` and `'IPv6'` are interpreted as `4` and `6` respectively. The value `0` indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used with `{ all: true }` (see below), either one of or both IPv4 and IPv6 addresses are returned, depending on the system's DNS resolver."
                    },
                    {
                      "textRaw": "`hints` {number} One or more supported `getaddrinfo` flags. Multiple flags may be passed by bitwise `OR`ing their values.",
                      "name": "hints",
                      "type": "number",
                      "desc": "One or more supported `getaddrinfo` flags. Multiple flags may be passed by bitwise `OR`ing their values."
                    },
                    {
                      "textRaw": "`all` {boolean} When `true`, the callback returns all resolved addresses in an array. Otherwise, returns a single address. **Default:** `false`.",
                      "name": "all",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "When `true`, the callback returns all resolved addresses in an array. Otherwise, returns a single address."
                    },
                    {
                      "textRaw": "`order` {string} When `verbatim`, the resolved addresses are return unsorted. When `ipv4first`, the resolved addresses are sorted by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6 addresses before IPv4 addresses. **Default:** `verbatim` (addresses are not reordered). Default value is configurable using `dns.setDefaultResultOrder()` or `--dns-result-order`.",
                      "name": "order",
                      "type": "string",
                      "default": "`verbatim` (addresses are not reordered). Default value is configurable using `dns.setDefaultResultOrder()` or `--dns-result-order`",
                      "desc": "When `verbatim`, the resolved addresses are return unsorted. When `ipv4first`, the resolved addresses are sorted by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6 addresses before IPv4 addresses."
                    },
                    {
                      "textRaw": "`verbatim` {boolean} When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4 addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified, `order` has higher precedence. New code should only use `order`. **Default:** `true` (addresses are not reordered). Default value is configurable using `dns.setDefaultResultOrder()` or `--dns-result-order`.",
                      "name": "verbatim",
                      "type": "boolean",
                      "default": "`true` (addresses are not reordered). Default value is configurable using `dns.setDefaultResultOrder()` or `--dns-result-order`",
                      "desc": "When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4 addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified, `order` has higher precedence. New code should only use `order`."
                    }
                  ],
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`address` {string} A string representation of an IPv4 or IPv6 address.",
                      "name": "address",
                      "type": "string",
                      "desc": "A string representation of an IPv4 or IPv6 address."
                    },
                    {
                      "textRaw": "`family` {integer} `4` or `6`, denoting the family of `address`, or `0` if the address is not an IPv4 or IPv6 address. `0` is a likely indicator of a bug in the name resolution service used by the operating system.",
                      "name": "family",
                      "type": "integer",
                      "desc": "`4` or `6`, denoting the family of `address`, or `0` if the address is not an IPv4 or IPv6 address. `0` is a likely indicator of a bug in the name resolution service used by the operating system."
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Resolves a host name (e.g. <code>'nodejs.org'</code>) into the first found A (IPv4) or\nAAAA (IPv6) record. All <code>option</code> properties are optional. If <code>options</code> is an\ninteger, then it must be <code>4</code> or <code>6</code> – if <code>options</code> is not provided, then\neither IPv4 or IPv6 addresses, or both, are returned if found.</p>\n<p>With the <code>all</code> option set to <code>true</code>, the arguments for <code>callback</code> change to\n<code>(err, addresses)</code>, with <code>addresses</code> being an array of objects with the\nproperties <code>address</code> and <code>family</code>.</p>\n<p>On error, <code>err</code> is an <a href=\"errors.html#class-error\"><code>Error</code></a> object, where <code>err.code</code> is the error code.\nKeep in mind that <code>err.code</code> will be set to <code>'ENOTFOUND'</code> not only when\nthe host name does not exist but also when the lookup fails in other ways\nsuch as no available file descriptors.</p>\n<p><code>dns.lookup()</code> does not necessarily have anything to do with the DNS protocol.\nThe implementation uses an operating system facility that can associate names\nwith addresses and vice versa. This implementation can have subtle but\nimportant consequences on the behavior of any Node.js program. Please take some\ntime to consult the <a href=\"#implementation-considerations\">Implementation considerations section</a> before using\n<code>dns.lookup()</code>.</p>\n<p>Example usage:</p>\n<pre><code class=\"language-mjs\">import dns from 'node:dns';\nconst options = {\n  family: 6,\n  hints: dns.ADDRCONFIG | dns.V4MAPPED,\n};\ndns.lookup('example.org', options, (err, address, family) =>\n  console.log('address: %j family: IPv%s', address, family));\n// address: \"2606:2800:21f:cb07:6820:80da:af6b:8b2c\" family: IPv6\n\n// When options.all is true, the result will be an Array.\noptions.all = true;\ndns.lookup('example.org', options, (err, addresses) =>\n  console.log('addresses: %j', addresses));\n// addresses: [{\"address\":\"2606:2800:21f:cb07:6820:80da:af6b:8b2c\",\"family\":6}]\n</code></pre>\n<pre><code class=\"language-cjs\">const dns = require('node:dns');\nconst options = {\n  family: 6,\n  hints: dns.ADDRCONFIG | dns.V4MAPPED,\n};\ndns.lookup('example.org', options, (err, address, family) =>\n  console.log('address: %j family: IPv%s', address, family));\n// address: \"2606:2800:21f:cb07:6820:80da:af6b:8b2c\" family: IPv6\n\n// When options.all is true, the result will be an Array.\noptions.all = true;\ndns.lookup('example.org', options, (err, addresses) =>\n  console.log('addresses: %j', addresses));\n// addresses: [{\"address\":\"2606:2800:21f:cb07:6820:80da:af6b:8b2c\",\"family\":6}]\n</code></pre>\n<p>If this method is invoked as its <a href=\"util.html#utilpromisifyoriginal\"><code>util.promisify()</code></a>ed version, and <code>all</code>\nis not set to <code>true</code>, it returns a <code>Promise</code> for an <code>Object</code> with <code>address</code> and\n<code>family</code> properties.</p>",
          "modules": [
            {
              "textRaw": "Supported getaddrinfo flags",
              "name": "supported_getaddrinfo_flags",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v13.13.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32183",
                    "description": "Added support for the `dns.ALL` flag."
                  }
                ]
              },
              "desc": "<p>The following flags can be passed as hints to <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a>.</p>\n<ul>\n<li><code>dns.ADDRCONFIG</code>: Limits returned address types to the types of non-loopback\naddresses configured on the system. For example, IPv4 addresses are only\nreturned if the current system has at least one IPv4 address configured.</li>\n<li><code>dns.V4MAPPED</code>: If the IPv6 family was specified, but no IPv6 addresses were\nfound, then return IPv4 mapped IPv6 addresses. It is not supported\non some operating systems (e.g. FreeBSD 10.1).</li>\n<li><code>dns.ALL</code>: If <code>dns.V4MAPPED</code> is specified, return resolved IPv6 addresses as\nwell as IPv4 mapped IPv6 addresses.</li>\n</ul>",
              "displayName": "Supported getaddrinfo flags"
            }
          ]
        },
        {
          "textRaw": "`dns.lookupService(address, port, callback)`",
          "name": "lookupService",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.14"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`address` {string}",
                  "name": "address",
                  "type": "string"
                },
                {
                  "textRaw": "`port` {number}",
                  "name": "port",
                  "type": "number"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`hostname` {string} e.g. `example.com`",
                      "name": "hostname",
                      "type": "string",
                      "desc": "e.g. `example.com`"
                    },
                    {
                      "textRaw": "`service` {string} e.g. `http`",
                      "name": "service",
                      "type": "string",
                      "desc": "e.g. `http`"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Resolves the given <code>address</code> and <code>port</code> into a host name and service using\nthe operating system's underlying <code>getnameinfo</code> implementation.</p>\n<p>If <code>address</code> is not a valid IP address, a <code>TypeError</code> will be thrown.\nThe <code>port</code> will be coerced to a number. If it is not a legal port, a <code>TypeError</code>\nwill be thrown.</p>\n<p>On an error, <code>err</code> is an <a href=\"errors.html#class-error\"><code>Error</code></a> object, where <code>err.code</code> is the error code.</p>\n<pre><code class=\"language-mjs\">import dns from 'node:dns';\ndns.lookupService('127.0.0.1', 22, (err, hostname, service) => {\n  console.log(hostname, service);\n  // Prints: localhost ssh\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const dns = require('node:dns');\ndns.lookupService('127.0.0.1', 22, (err, hostname, service) => {\n  console.log(hostname, service);\n  // Prints: localhost ssh\n});\n</code></pre>\n<p>If this method is invoked as its <a href=\"util.html#utilpromisifyoriginal\"><code>util.promisify()</code></a>ed version, it returns a\n<code>Promise</code> for an <code>Object</code> with <code>hostname</code> and <code>service</code> properties.</p>"
        },
        {
          "textRaw": "`dns.resolve(hostname[, rrtype], callback)`",
          "name": "resolve",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.27"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string} Host name to resolve.",
                  "name": "hostname",
                  "type": "string",
                  "desc": "Host name to resolve."
                },
                {
                  "textRaw": "`rrtype` {string} Resource record type. **Default:** `'A'`.",
                  "name": "rrtype",
                  "type": "string",
                  "default": "`'A'`",
                  "desc": "Resource record type.",
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`records` {string[]|Object[]|Object}",
                      "name": "records",
                      "type": "string[]|Object[]|Object"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve a host name (e.g. <code>'nodejs.org'</code>) into an array\nof the resource records. The <code>callback</code> function has arguments\n<code>(err, records)</code>. When successful, <code>records</code> will be an array of resource\nrecords. The type and structure of individual results varies based on <code>rrtype</code>:</p>\n<table>\n<thead>\n<tr>\n<th><code>rrtype</code></th>\n<th><code>records</code> contains</th>\n<th>Result type</th>\n<th>Shorthand method</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'A'</code></td>\n<td>IPv4 addresses (default)</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnsresolve4hostname-options-callback\"><code>dns.resolve4()</code></a></td>\n</tr>\n<tr>\n<td><code>'AAAA'</code></td>\n<td>IPv6 addresses</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnsresolve6hostname-options-callback\"><code>dns.resolve6()</code></a></td>\n</tr>\n<tr>\n<td><code>'ANY'</code></td>\n<td>any records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnsresolveanyhostname-callback\"><code>dns.resolveAny()</code></a></td>\n</tr>\n<tr>\n<td><code>'CAA'</code></td>\n<td>CA authorization records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnsresolvecaahostname-callback\"><code>dns.resolveCaa()</code></a></td>\n</tr>\n<tr>\n<td><code>'CNAME'</code></td>\n<td>canonical name records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnsresolvecnamehostname-callback\"><code>dns.resolveCname()</code></a></td>\n</tr>\n<tr>\n<td><code>'MX'</code></td>\n<td>mail exchange records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnsresolvemxhostname-callback\"><code>dns.resolveMx()</code></a></td>\n</tr>\n<tr>\n<td><code>'NAPTR'</code></td>\n<td>name authority pointer records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnsresolvenaptrhostname-callback\"><code>dns.resolveNaptr()</code></a></td>\n</tr>\n<tr>\n<td><code>'NS'</code></td>\n<td>name server records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnsresolvenshostname-callback\"><code>dns.resolveNs()</code></a></td>\n</tr>\n<tr>\n<td><code>'PTR'</code></td>\n<td>pointer records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnsresolveptrhostname-callback\"><code>dns.resolvePtr()</code></a></td>\n</tr>\n<tr>\n<td><code>'SOA'</code></td>\n<td>start of authority records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnsresolvesoahostname-callback\"><code>dns.resolveSoa()</code></a></td>\n</tr>\n<tr>\n<td><code>'SRV'</code></td>\n<td>service records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnsresolvesrvhostname-callback\"><code>dns.resolveSrv()</code></a></td>\n</tr>\n<tr>\n<td><code>'TLSA'</code></td>\n<td>certificate associations</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnsresolvetlsahostname-callback\"><code>dns.resolveTlsa()</code></a></td>\n</tr>\n<tr>\n<td><code>'TXT'</code></td>\n<td>text records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a></td>\n<td><a href=\"#dnsresolvetxthostname-callback\"><code>dns.resolveTxt()</code></a></td>\n</tr>\n</tbody>\n</table>\n<p>On error, <code>err</code> is an <a href=\"errors.html#class-error\"><code>Error</code></a> object, where <code>err.code</code> is one of the\n<a href=\"#error-codes\">DNS error codes</a>.</p>"
        },
        {
          "textRaw": "`dns.resolve4(hostname[, options], callback)`",
          "name": "resolve4",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              },
              {
                "version": "v7.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/9296",
                "description": "This method now supports passing `options`, specifically `options.ttl`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string} Host name to resolve.",
                  "name": "hostname",
                  "type": "string",
                  "desc": "Host name to resolve."
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`ttl` {boolean} Retrieves the Time-To-Live value (TTL) of each record. When `true`, the callback receives an array of `{ address: '1.2.3.4', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds.",
                      "name": "ttl",
                      "type": "boolean",
                      "desc": "Retrieves the Time-To-Live value (TTL) of each record. When `true`, the callback receives an array of `{ address: '1.2.3.4', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds."
                    }
                  ],
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`addresses` {string[]|Object[]}",
                      "name": "addresses",
                      "type": "string[]|Object[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve a IPv4 addresses (<code>A</code> records) for the\n<code>hostname</code>. The <code>addresses</code> argument passed to the <code>callback</code> function\nwill contain an array of IPv4 addresses (e.g.\n<code>['74.125.79.104', '74.125.79.105', '74.125.79.106']</code>).</p>"
        },
        {
          "textRaw": "`dns.resolve6(hostname[, options], callback)`",
          "name": "resolve6",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              },
              {
                "version": "v7.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/9296",
                "description": "This method now supports passing `options`, specifically `options.ttl`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string} Host name to resolve.",
                  "name": "hostname",
                  "type": "string",
                  "desc": "Host name to resolve."
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record. When `true`, the callback receives an array of `{ address: '0:1:2:3:4:5:6:7', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds.",
                      "name": "ttl",
                      "type": "boolean",
                      "desc": "Retrieve the Time-To-Live value (TTL) of each record. When `true`, the callback receives an array of `{ address: '0:1:2:3:4:5:6:7', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds."
                    }
                  ],
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`addresses` {string[]|Object[]}",
                      "name": "addresses",
                      "type": "string[]|Object[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve IPv6 addresses (<code>AAAA</code> records) for the\n<code>hostname</code>. The <code>addresses</code> argument passed to the <code>callback</code> function\nwill contain an array of IPv6 addresses.</p>"
        },
        {
          "textRaw": "`dns.resolveAny(hostname, callback)`",
          "name": "resolveAny",
          "type": "method",
          "meta": {
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`ret` {Object[]}",
                      "name": "ret",
                      "type": "Object[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve all records (also known as <code>ANY</code> or <code>*</code> query).\nThe <code>ret</code> argument passed to the <code>callback</code> function will be an array containing\nvarious types of records. Each object has a property <code>type</code> that indicates the\ntype of the current record. And depending on the <code>type</code>, additional properties\nwill be present on the object:</p>\n<table>\n<thead>\n<tr>\n<th>Type</th>\n<th>Properties</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'A'</code></td>\n<td><code>address</code>/<code>ttl</code></td>\n</tr>\n<tr>\n<td><code>'AAAA'</code></td>\n<td><code>address</code>/<code>ttl</code></td>\n</tr>\n<tr>\n<td><code>'CAA'</code></td>\n<td>Refer to <a href=\"#dnsresolvecaahostname-callback\"><code>dns.resolveCaa()</code></a></td>\n</tr>\n<tr>\n<td><code>'CNAME'</code></td>\n<td><code>value</code></td>\n</tr>\n<tr>\n<td><code>'MX'</code></td>\n<td>Refer to <a href=\"#dnsresolvemxhostname-callback\"><code>dns.resolveMx()</code></a></td>\n</tr>\n<tr>\n<td><code>'NAPTR'</code></td>\n<td>Refer to <a href=\"#dnsresolvenaptrhostname-callback\"><code>dns.resolveNaptr()</code></a></td>\n</tr>\n<tr>\n<td><code>'NS'</code></td>\n<td><code>value</code></td>\n</tr>\n<tr>\n<td><code>'PTR'</code></td>\n<td><code>value</code></td>\n</tr>\n<tr>\n<td><code>'SOA'</code></td>\n<td>Refer to <a href=\"#dnsresolvesoahostname-callback\"><code>dns.resolveSoa()</code></a></td>\n</tr>\n<tr>\n<td><code>'SRV'</code></td>\n<td>Refer to <a href=\"#dnsresolvesrvhostname-callback\"><code>dns.resolveSrv()</code></a></td>\n</tr>\n<tr>\n<td><code>'TLSA'</code></td>\n<td>Refer to <a href=\"#dnsresolvetlsahostname-callback\"><code>dns.resolveTlsa()</code></a></td>\n</tr>\n<tr>\n<td><code>'TXT'</code></td>\n<td>This type of record contains an array property called <code>entries</code> which refers to <a href=\"#dnsresolvetxthostname-callback\"><code>dns.resolveTxt()</code></a>, e.g. <code>{ entries: ['...'], type: 'TXT' }</code></td>\n</tr>\n</tbody>\n</table>\n<p>Here is an example of the <code>ret</code> object passed to the callback:</p>\n<pre><code class=\"language-js\">[ { type: 'A', address: '127.0.0.1', ttl: 299 },\n  { type: 'CNAME', value: 'example.com' },\n  { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 },\n  { type: 'NS', value: 'ns1.example.com' },\n  { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] },\n  { type: 'SOA',\n    nsname: 'ns1.example.com',\n    hostmaster: 'admin.example.com',\n    serial: 156696742,\n    refresh: 900,\n    retry: 900,\n    expire: 1800,\n    minttl: 60 } ]\n</code></pre>\n<p>DNS server operators may choose not to respond to <code>ANY</code>\nqueries. It may be better to call individual methods like <a href=\"#dnsresolve4hostname-options-callback\"><code>dns.resolve4()</code></a>,\n<a href=\"#dnsresolvemxhostname-callback\"><code>dns.resolveMx()</code></a>, and so on. For more details, see <a href=\"https://tools.ietf.org/html/rfc8482\">RFC 8482</a>.</p>"
        },
        {
          "textRaw": "`dns.resolveCname(hostname, callback)`",
          "name": "resolveCname",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.2"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`addresses` {string[]}",
                      "name": "addresses",
                      "type": "string[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve <code>CNAME</code> records for the <code>hostname</code>. The\n<code>addresses</code> argument passed to the <code>callback</code> function\nwill contain an array of canonical name records available for the <code>hostname</code>\n(e.g. <code>['bar.example.com']</code>).</p>"
        },
        {
          "textRaw": "`dns.resolveCaa(hostname, callback)`",
          "name": "resolveCaa",
          "type": "method",
          "meta": {
            "added": [
              "v15.0.0",
              "v14.17.0"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`records` {Object[]}",
                      "name": "records",
                      "type": "Object[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve <code>CAA</code> records for the <code>hostname</code>. The\n<code>addresses</code> argument passed to the <code>callback</code> function\nwill contain an array of certification authority authorization records\navailable for the <code>hostname</code> (e.g. <code>[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]</code>).</p>"
        },
        {
          "textRaw": "`dns.resolveMx(hostname, callback)`",
          "name": "resolveMx",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.27"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`addresses` {Object[]}",
                      "name": "addresses",
                      "type": "Object[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve mail exchange records (<code>MX</code> records) for the\n<code>hostname</code>. The <code>addresses</code> argument passed to the <code>callback</code> function will\ncontain an array of objects containing both a <code>priority</code> and <code>exchange</code>\nproperty (e.g. <code>[{priority: 10, exchange: 'mx.example.com'}, ...]</code>).</p>"
        },
        {
          "textRaw": "`dns.resolveNaptr(hostname, callback)`",
          "name": "resolveNaptr",
          "type": "method",
          "meta": {
            "added": [
              "v0.9.12"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`addresses` {Object[]}",
                      "name": "addresses",
                      "type": "Object[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve regular expression-based records (<code>NAPTR</code>\nrecords) for the <code>hostname</code>. The <code>addresses</code> argument passed to the <code>callback</code>\nfunction will contain an array of objects with the following properties:</p>\n<ul>\n<li><code>flags</code></li>\n<li><code>service</code></li>\n<li><code>regexp</code></li>\n<li><code>replacement</code></li>\n<li><code>order</code></li>\n<li><code>preference</code></li>\n</ul>\n<pre><code class=\"language-js\">{\n  flags: 's',\n  service: 'SIP+D2U',\n  regexp: '',\n  replacement: '_sip._udp.example.com',\n  order: 30,\n  preference: 100\n}\n</code></pre>"
        },
        {
          "textRaw": "`dns.resolveNs(hostname, callback)`",
          "name": "resolveNs",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.90"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`addresses` {string[]}",
                      "name": "addresses",
                      "type": "string[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve name server records (<code>NS</code> records) for the\n<code>hostname</code>. The <code>addresses</code> argument passed to the <code>callback</code> function will\ncontain an array of name server records available for <code>hostname</code>\n(e.g. <code>['ns1.example.com', 'ns2.example.com']</code>).</p>"
        },
        {
          "textRaw": "`dns.resolvePtr(hostname, callback)`",
          "name": "resolvePtr",
          "type": "method",
          "meta": {
            "added": [
              "v6.0.0"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`addresses` {string[]}",
                      "name": "addresses",
                      "type": "string[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve pointer records (<code>PTR</code> records) for the\n<code>hostname</code>. The <code>addresses</code> argument passed to the <code>callback</code> function will\nbe an array of strings containing the reply records.</p>"
        },
        {
          "textRaw": "`dns.resolveSoa(hostname, callback)`",
          "name": "resolveSoa",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.10"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`address` {Object}",
                      "name": "address",
                      "type": "Object"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve a start of authority record (<code>SOA</code> record) for\nthe <code>hostname</code>. The <code>address</code> argument passed to the <code>callback</code> function will\nbe an object with the following properties:</p>\n<ul>\n<li><code>nsname</code></li>\n<li><code>hostmaster</code></li>\n<li><code>serial</code></li>\n<li><code>refresh</code></li>\n<li><code>retry</code></li>\n<li><code>expire</code></li>\n<li><code>minttl</code></li>\n</ul>\n<pre><code class=\"language-js\">{\n  nsname: 'ns.example.com',\n  hostmaster: 'root.example.com',\n  serial: 2013101809,\n  refresh: 10000,\n  retry: 2400,\n  expire: 604800,\n  minttl: 3600\n}\n</code></pre>"
        },
        {
          "textRaw": "`dns.resolveSrv(hostname, callback)`",
          "name": "resolveSrv",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.27"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`addresses` {Object[]}",
                      "name": "addresses",
                      "type": "Object[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve service records (<code>SRV</code> records) for the\n<code>hostname</code>. The <code>addresses</code> argument passed to the <code>callback</code> function will\nbe an array of objects with the following properties:</p>\n<ul>\n<li><code>priority</code></li>\n<li><code>weight</code></li>\n<li><code>port</code></li>\n<li><code>name</code></li>\n</ul>\n<pre><code class=\"language-js\">{\n  priority: 10,\n  weight: 5,\n  port: 21223,\n  name: 'service.example.com'\n}\n</code></pre>"
        },
        {
          "textRaw": "`dns.resolveTlsa(hostname, callback)`",
          "name": "resolveTlsa",
          "type": "method",
          "meta": {
            "added": [
              "v23.9.0",
              "v22.15.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`records` {Object[]}",
                      "name": "records",
                      "type": "Object[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve certificate associations (<code>TLSA</code> records) for\nthe <code>hostname</code>. The <code>records</code> argument passed to the <code>callback</code> function is an\narray of objects with these properties:</p>\n<ul>\n<li><code>certUsage</code></li>\n<li><code>selector</code></li>\n<li><code>match</code></li>\n<li><code>data</code></li>\n</ul>\n<pre><code class=\"language-js\">{\n  certUsage: 3,\n  selector: 1,\n  match: 1,\n  data: [ArrayBuffer]\n}\n</code></pre>"
        },
        {
          "textRaw": "`dns.resolveTxt(hostname, callback)`",
          "name": "resolveTxt",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.27"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`records` {string[]}",
                      "name": "records",
                      "type": "string[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve text queries (<code>TXT</code> records) for the\n<code>hostname</code>. The <code>records</code> argument passed to the <code>callback</code> function is a\ntwo-dimensional array of the text records available for <code>hostname</code> (e.g.\n<code>[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]</code>). Each sub-array contains TXT chunks of\none record. Depending on the use case, these could be either joined together or\ntreated separately.</p>"
        },
        {
          "textRaw": "`dns.reverse(ip, callback)`",
          "name": "reverse",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`ip` {string}",
                  "name": "ip",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`hostnames` {string[]}",
                      "name": "hostnames",
                      "type": "string[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an\narray of host names.</p>\n<p>On error, <code>err</code> is an <a href=\"errors.html#class-error\"><code>Error</code></a> object, where <code>err.code</code> is\none of the <a href=\"#error-codes\">DNS error codes</a>.</p>"
        },
        {
          "textRaw": "`dns.setDefaultResultOrder(order)`",
          "name": "setDefaultResultOrder",
          "type": "method",
          "meta": {
            "added": [
              "v16.4.0",
              "v14.18.0"
            ],
            "changes": [
              {
                "version": [
                  "v22.1.0",
                  "v20.13.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/52492",
                "description": "The `ipv6first` value is supported now."
              },
              {
                "version": "v17.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/39987",
                "description": "Changed default value to `verbatim`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`order` {string} must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.",
                  "name": "order",
                  "type": "string",
                  "desc": "must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`."
                }
              ]
            }
          ],
          "desc": "<p>Set the default value of <code>order</code> in <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> and\n<a href=\"#dnspromiseslookuphostname-options\"><code>dnsPromises.lookup()</code></a>. The value could be:</p>\n<ul>\n<li><code>ipv4first</code>: sets default <code>order</code> to <code>ipv4first</code>.</li>\n<li><code>ipv6first</code>: sets default <code>order</code> to <code>ipv6first</code>.</li>\n<li><code>verbatim</code>: sets default <code>order</code> to <code>verbatim</code>.</li>\n</ul>\n<p>The default is <code>verbatim</code> and <a href=\"#dnssetdefaultresultorderorder\"><code>dns.setDefaultResultOrder()</code></a> have higher\npriority than <a href=\"cli.html#--dns-result-orderorder\"><code>--dns-result-order</code></a>. When using <a href=\"worker_threads.html\">worker threads</a>,\n<a href=\"#dnssetdefaultresultorderorder\"><code>dns.setDefaultResultOrder()</code></a> from the main thread won't affect the default\ndns orders in workers.</p>"
        },
        {
          "textRaw": "`dns.getDefaultResultOrder()`",
          "name": "getDefaultResultOrder",
          "type": "method",
          "meta": {
            "added": [
              "v20.1.0",
              "v18.17.0"
            ],
            "changes": [
              {
                "version": [
                  "v22.1.0",
                  "v20.13.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/52492",
                "description": "The `ipv6first` value is supported now."
              }
            ]
          },
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>Get the default value for <code>order</code> in <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> and\n<a href=\"#dnspromiseslookuphostname-options\"><code>dnsPromises.lookup()</code></a>. The value could be:</p>\n<ul>\n<li><code>ipv4first</code>: for <code>order</code> defaulting to <code>ipv4first</code>.</li>\n<li><code>ipv6first</code>: for <code>order</code> defaulting to <code>ipv6first</code>.</li>\n<li><code>verbatim</code>: for <code>order</code> defaulting to <code>verbatim</code>.</li>\n</ul>"
        },
        {
          "textRaw": "`dns.setServers(servers)`",
          "name": "setServers",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`servers` {string[]} array of RFC 5952 formatted addresses",
                  "name": "servers",
                  "type": "string[]",
                  "desc": "array of RFC 5952 formatted addresses"
                }
              ]
            }
          ],
          "desc": "<p>Sets the IP address and port of servers to be used when performing DNS\nresolution. The <code>servers</code> argument is an array of <a href=\"https://tools.ietf.org/html/rfc5952#section-6\">RFC 5952</a> formatted\naddresses. If the port is the IANA default DNS port (53) it can be omitted.</p>\n<pre><code class=\"language-js\">dns.setServers([\n  '8.8.8.8',\n  '[2001:4860:4860::8888]',\n  '8.8.8.8:1053',\n  '[2001:4860:4860::8888]:1053',\n]);\n</code></pre>\n<p>An error will be thrown if an invalid address is provided.</p>\n<p>The <code>dns.setServers()</code> method must not be called while a DNS query is in\nprogress.</p>\n<p>The <a href=\"#dnssetserversservers\"><code>dns.setServers()</code></a> method affects only <a href=\"#dnsresolvehostname-rrtype-callback\"><code>dns.resolve()</code></a>,\n<code>dns.resolve*()</code> and <a href=\"#dnsreverseip-callback\"><code>dns.reverse()</code></a> (and specifically <em>not</em>\n<a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a>).</p>\n<p>This method works much like\n<a href=\"https://man7.org/linux/man-pages/man5/resolv.conf.5.html\">resolve.conf</a>.\nThat is, if attempting to resolve with the first server provided results in a\n<code>NOTFOUND</code> error, the <code>resolve()</code> method will <em>not</em> attempt to resolve with\nsubsequent servers provided. Fallback DNS servers will only be used if the\nearlier ones time out or result in some other error.</p>"
        }
      ],
      "modules": [
        {
          "textRaw": "DNS promises API",
          "name": "dns_promises_api",
          "type": "module",
          "meta": {
            "added": [
              "v10.6.0"
            ],
            "changes": [
              {
                "version": "v15.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/32953",
                "description": "Exposed as `require('dns/promises')`."
              },
              {
                "version": [
                  "v11.14.0",
                  "v10.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/26592",
                "description": "This API is no longer experimental."
              }
            ]
          },
          "desc": "<p>The <code>dns.promises</code> API provides an alternative set of asynchronous DNS methods\nthat return <code>Promise</code> objects rather than using callbacks. The API is accessible\nvia <code>require('node:dns').promises</code> or <code>require('node:dns/promises')</code>.</p>",
          "classes": [
            {
              "textRaw": "Class: `dnsPromises.Resolver`",
              "name": "dnsPromises.Resolver",
              "type": "class",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "desc": "<p>An independent resolver for DNS requests.</p>\n<p>Creating a new resolver uses the default server settings. Setting\nthe servers used for a resolver using\n<a href=\"#dnspromisessetserversservers\"><code>resolver.setServers()</code></a> does not affect\nother resolvers:</p>\n<pre><code class=\"language-mjs\">import { Resolver } from 'node:dns/promises';\nconst resolver = new Resolver();\nresolver.setServers(['4.4.4.4']);\n\n// This request will use the server at 4.4.4.4, independent of global settings.\nconst addresses = await resolver.resolve4('example.org');\n</code></pre>\n<pre><code class=\"language-cjs\">const { Resolver } = require('node:dns').promises;\nconst resolver = new Resolver();\nresolver.setServers(['4.4.4.4']);\n\n// This request will use the server at 4.4.4.4, independent of global settings.\nresolver.resolve4('example.org').then((addresses) => {\n  // ...\n});\n\n// Alternatively, the same code can be written using async-await style.\n(async function() {\n  const addresses = await resolver.resolve4('example.org');\n})();\n</code></pre>\n<p>The following methods from the <code>dnsPromises</code> API are available:</p>\n<ul>\n<li><a href=\"#dnspromisesgetservers\"><code>resolver.getServers()</code></a></li>\n<li><a href=\"#dnspromisesresolvehostname-rrtype\"><code>resolver.resolve()</code></a></li>\n<li><a href=\"#dnspromisesresolve4hostname-options\"><code>resolver.resolve4()</code></a></li>\n<li><a href=\"#dnspromisesresolve6hostname-options\"><code>resolver.resolve6()</code></a></li>\n<li><a href=\"#dnspromisesresolveanyhostname\"><code>resolver.resolveAny()</code></a></li>\n<li><a href=\"#dnspromisesresolvecaahostname\"><code>resolver.resolveCaa()</code></a></li>\n<li><a href=\"#dnspromisesresolvecnamehostname\"><code>resolver.resolveCname()</code></a></li>\n<li><a href=\"#dnspromisesresolvemxhostname\"><code>resolver.resolveMx()</code></a></li>\n<li><a href=\"#dnspromisesresolvenaptrhostname\"><code>resolver.resolveNaptr()</code></a></li>\n<li><a href=\"#dnspromisesresolvenshostname\"><code>resolver.resolveNs()</code></a></li>\n<li><a href=\"#dnspromisesresolveptrhostname\"><code>resolver.resolvePtr()</code></a></li>\n<li><a href=\"#dnspromisesresolvesoahostname\"><code>resolver.resolveSoa()</code></a></li>\n<li><a href=\"#dnspromisesresolvesrvhostname\"><code>resolver.resolveSrv()</code></a></li>\n<li><a href=\"#dnspromisesresolvetlsahostname\"><code>resolver.resolveTlsa()</code></a></li>\n<li><a href=\"#dnspromisesresolvetxthostname\"><code>resolver.resolveTxt()</code></a></li>\n<li><a href=\"#dnspromisesreverseip\"><code>resolver.reverse()</code></a></li>\n<li><a href=\"#dnspromisessetserversservers\"><code>resolver.setServers()</code></a></li>\n</ul>"
            }
          ],
          "methods": [
            {
              "textRaw": "`resolver.cancel()`",
              "name": "cancel",
              "type": "method",
              "meta": {
                "added": [
                  "v15.3.0",
                  "v14.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Cancel all outstanding DNS queries made by this resolver. The corresponding\npromises will be rejected with an error with the code <code>ECANCELLED</code>.</p>"
            },
            {
              "textRaw": "`dnsPromises.getServers()`",
              "name": "getServers",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string[]}",
                    "name": "return",
                    "type": "string[]"
                  }
                }
              ],
              "desc": "<p>Returns an array of IP address strings, formatted according to <a href=\"https://tools.ietf.org/html/rfc5952#section-6\">RFC 5952</a>,\nthat are currently configured for DNS resolution. A string will include a port\nsection if a custom port is used.</p>\n<pre><code class=\"language-js\">[\n  '8.8.8.8',\n  '2001:4860:4860::8888',\n  '8.8.8.8:1053',\n  '[2001:4860:4860::8888]:1053',\n]\n</code></pre>"
            },
            {
              "textRaw": "`dnsPromises.lookup(hostname[, options])`",
              "name": "lookup",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.1.0",
                      "v20.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/52492",
                    "description": "The `verbatim` option is now deprecated in favor of the new `order` option."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    },
                    {
                      "textRaw": "`options` {integer|Object}",
                      "name": "options",
                      "type": "integer|Object",
                      "options": [
                        {
                          "textRaw": "`family` {integer} The record family. Must be `4`, `6`, or `0`. The value `0` indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used with `{ all: true }` (see below), either one of or both IPv4 and IPv6 addresses are returned, depending on the system's DNS resolver. **Default:** `0`.",
                          "name": "family",
                          "type": "integer",
                          "default": "`0`",
                          "desc": "The record family. Must be `4`, `6`, or `0`. The value `0` indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used with `{ all: true }` (see below), either one of or both IPv4 and IPv6 addresses are returned, depending on the system's DNS resolver."
                        },
                        {
                          "textRaw": "`hints` {number} One or more supported `getaddrinfo` flags. Multiple flags may be passed by bitwise `OR`ing their values.",
                          "name": "hints",
                          "type": "number",
                          "desc": "One or more supported `getaddrinfo` flags. Multiple flags may be passed by bitwise `OR`ing their values."
                        },
                        {
                          "textRaw": "`all` {boolean} When `true`, the `Promise` is resolved with all addresses in an array. Otherwise, returns a single address. **Default:** `false`.",
                          "name": "all",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, the `Promise` is resolved with all addresses in an array. Otherwise, returns a single address."
                        },
                        {
                          "textRaw": "`order` {string} When `verbatim`, the `Promise` is resolved with IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `ipv4first`, IPv4 addresses are placed before IPv6 addresses. When `ipv6first`, IPv6 addresses are placed before IPv4 addresses. **Default:** `verbatim` (addresses are not reordered). Default value is configurable using `dns.setDefaultResultOrder()` or `--dns-result-order`. New code should use `{ order: 'verbatim' }`.",
                          "name": "order",
                          "type": "string",
                          "default": "`verbatim` (addresses are not reordered). Default value is configurable using `dns.setDefaultResultOrder()` or `--dns-result-order`. New code should use `{ order: 'verbatim' }`",
                          "desc": "When `verbatim`, the `Promise` is resolved with IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `ipv4first`, IPv4 addresses are placed before IPv6 addresses. When `ipv6first`, IPv6 addresses are placed before IPv4 addresses."
                        },
                        {
                          "textRaw": "`verbatim` {boolean} When `true`, the `Promise` is resolved with IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4 addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified, `order` has higher precedence. New code should only use `order`. **Default:** currently `false` (addresses are reordered) but this is expected to change in the not too distant future. Default value is configurable using `dns.setDefaultResultOrder()` or `--dns-result-order`.",
                          "name": "verbatim",
                          "type": "boolean",
                          "default": "currently `false` (addresses are reordered) but this is expected to change in the not too distant future. Default value is configurable using `dns.setDefaultResultOrder()` or `--dns-result-order`",
                          "desc": "When `true`, the `Promise` is resolved with IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4 addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified, `order` has higher precedence. New code should only use `order`."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Resolves a host name (e.g. <code>'nodejs.org'</code>) into the first found A (IPv4) or\nAAAA (IPv6) record. All <code>option</code> properties are optional. If <code>options</code> is an\ninteger, then it must be <code>4</code> or <code>6</code> – if <code>options</code> is not provided, then\neither IPv4 or IPv6 addresses, or both, are returned if found.</p>\n<p>With the <code>all</code> option set to <code>true</code>, the <code>Promise</code> is resolved with <code>addresses</code>\nbeing an array of objects with the properties <code>address</code> and <code>family</code>.</p>\n<p>On error, the <code>Promise</code> is rejected with an <a href=\"errors.html#class-error\"><code>Error</code></a> object, where <code>err.code</code>\nis the error code.\nKeep in mind that <code>err.code</code> will be set to <code>'ENOTFOUND'</code> not only when\nthe host name does not exist but also when the lookup fails in other ways\nsuch as no available file descriptors.</p>\n<p><a href=\"#dnspromiseslookuphostname-options\"><code>dnsPromises.lookup()</code></a> does not necessarily have anything to do with the DNS\nprotocol. The implementation uses an operating system facility that can\nassociate names with addresses and vice versa. This implementation can have\nsubtle but important consequences on the behavior of any Node.js program. Please\ntake some time to consult the <a href=\"#implementation-considerations\">Implementation considerations section</a> before\nusing <code>dnsPromises.lookup()</code>.</p>\n<p>Example usage:</p>\n<pre><code class=\"language-mjs\">import dns from 'node:dns';\nconst dnsPromises = dns.promises;\nconst options = {\n  family: 6,\n  hints: dns.ADDRCONFIG | dns.V4MAPPED,\n};\n\nawait dnsPromises.lookup('example.org', options).then((result) => {\n  console.log('address: %j family: IPv%s', result.address, result.family);\n  // address: \"2606:2800:21f:cb07:6820:80da:af6b:8b2c\" family: IPv6\n});\n\n// When options.all is true, the result will be an Array.\noptions.all = true;\nawait dnsPromises.lookup('example.org', options).then((result) => {\n  console.log('addresses: %j', result);\n  // addresses: [{\"address\":\"2606:2800:21f:cb07:6820:80da:af6b:8b2c\",\"family\":6}]\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const dns = require('node:dns');\nconst dnsPromises = dns.promises;\nconst options = {\n  family: 6,\n  hints: dns.ADDRCONFIG | dns.V4MAPPED,\n};\n\ndnsPromises.lookup('example.org', options).then((result) => {\n  console.log('address: %j family: IPv%s', result.address, result.family);\n  // address: \"2606:2800:21f:cb07:6820:80da:af6b:8b2c\" family: IPv6\n});\n\n// When options.all is true, the result will be an Array.\noptions.all = true;\ndnsPromises.lookup('example.org', options).then((result) => {\n  console.log('addresses: %j', result);\n  // addresses: [{\"address\":\"2606:2800:21f:cb07:6820:80da:af6b:8b2c\",\"family\":6}]\n});\n</code></pre>"
            },
            {
              "textRaw": "`dnsPromises.lookupService(address, port)`",
              "name": "lookupService",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`address` {string}",
                      "name": "address",
                      "type": "string"
                    },
                    {
                      "textRaw": "`port` {number}",
                      "name": "port",
                      "type": "number"
                    }
                  ]
                }
              ],
              "desc": "<p>Resolves the given <code>address</code> and <code>port</code> into a host name and service using\nthe operating system's underlying <code>getnameinfo</code> implementation.</p>\n<p>If <code>address</code> is not a valid IP address, a <code>TypeError</code> will be thrown.\nThe <code>port</code> will be coerced to a number. If it is not a legal port, a <code>TypeError</code>\nwill be thrown.</p>\n<p>On error, the <code>Promise</code> is rejected with an <a href=\"errors.html#class-error\"><code>Error</code></a> object, where <code>err.code</code>\nis the error code.</p>\n<pre><code class=\"language-mjs\">import dnsPromises from 'node:dns/promises';\nconst result = await dnsPromises.lookupService('127.0.0.1', 22);\n\nconsole.log(result.hostname, result.service); // Prints: localhost ssh\n</code></pre>\n<pre><code class=\"language-cjs\">const dnsPromises = require('node:dns').promises;\ndnsPromises.lookupService('127.0.0.1', 22).then((result) => {\n  console.log(result.hostname, result.service);\n  // Prints: localhost ssh\n});\n</code></pre>"
            },
            {
              "textRaw": "`dnsPromises.resolve(hostname[, rrtype])`",
              "name": "resolve",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string} Host name to resolve.",
                      "name": "hostname",
                      "type": "string",
                      "desc": "Host name to resolve."
                    },
                    {
                      "textRaw": "`rrtype` {string} Resource record type. **Default:** `'A'`.",
                      "name": "rrtype",
                      "type": "string",
                      "default": "`'A'`",
                      "desc": "Resource record type.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve a host name (e.g. <code>'nodejs.org'</code>) into an array\nof the resource records. When successful, the <code>Promise</code> is resolved with an\narray of resource records. The type and structure of individual results vary\nbased on <code>rrtype</code>:</p>\n<table>\n<thead>\n<tr>\n<th><code>rrtype</code></th>\n<th><code>records</code> contains</th>\n<th>Result type</th>\n<th>Shorthand method</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'A'</code></td>\n<td>IPv4 addresses (default)</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnspromisesresolve4hostname-options\"><code>dnsPromises.resolve4()</code></a></td>\n</tr>\n<tr>\n<td><code>'AAAA'</code></td>\n<td>IPv6 addresses</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnspromisesresolve6hostname-options\"><code>dnsPromises.resolve6()</code></a></td>\n</tr>\n<tr>\n<td><code>'ANY'</code></td>\n<td>any records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnspromisesresolveanyhostname\"><code>dnsPromises.resolveAny()</code></a></td>\n</tr>\n<tr>\n<td><code>'CAA'</code></td>\n<td>CA authorization records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnspromisesresolvecaahostname\"><code>dnsPromises.resolveCaa()</code></a></td>\n</tr>\n<tr>\n<td><code>'CNAME'</code></td>\n<td>canonical name records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnspromisesresolvecnamehostname\"><code>dnsPromises.resolveCname()</code></a></td>\n</tr>\n<tr>\n<td><code>'MX'</code></td>\n<td>mail exchange records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnspromisesresolvemxhostname\"><code>dnsPromises.resolveMx()</code></a></td>\n</tr>\n<tr>\n<td><code>'NAPTR'</code></td>\n<td>name authority pointer records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnspromisesresolvenaptrhostname\"><code>dnsPromises.resolveNaptr()</code></a></td>\n</tr>\n<tr>\n<td><code>'NS'</code></td>\n<td>name server records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnspromisesresolvenshostname\"><code>dnsPromises.resolveNs()</code></a></td>\n</tr>\n<tr>\n<td><code>'PTR'</code></td>\n<td>pointer records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnspromisesresolveptrhostname\"><code>dnsPromises.resolvePtr()</code></a></td>\n</tr>\n<tr>\n<td><code>'SOA'</code></td>\n<td>start of authority records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnspromisesresolvesoahostname\"><code>dnsPromises.resolveSoa()</code></a></td>\n</tr>\n<tr>\n<td><code>'SRV'</code></td>\n<td>service records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnspromisesresolvesrvhostname\"><code>dnsPromises.resolveSrv()</code></a></td>\n</tr>\n<tr>\n<td><code>'TLSA'</code></td>\n<td>certificate associations</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnspromisesresolvetlsahostname\"><code>dnsPromises.resolveTlsa()</code></a></td>\n</tr>\n<tr>\n<td><code>'TXT'</code></td>\n<td>text records</td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a></td>\n<td><a href=\"#dnspromisesresolvetxthostname\"><code>dnsPromises.resolveTxt()</code></a></td>\n</tr>\n</tbody>\n</table>\n<p>On error, the <code>Promise</code> is rejected with an <a href=\"errors.html#class-error\"><code>Error</code></a> object, where <code>err.code</code>\nis one of the <a href=\"#error-codes\">DNS error codes</a>.</p>"
            },
            {
              "textRaw": "`dnsPromises.resolve4(hostname[, options])`",
              "name": "resolve4",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string} Host name to resolve.",
                      "name": "hostname",
                      "type": "string",
                      "desc": "Host name to resolve."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record. When `true`, the `Promise` is resolved with an array of `{ address: '1.2.3.4', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds.",
                          "name": "ttl",
                          "type": "boolean",
                          "desc": "Retrieve the Time-To-Live value (TTL) of each record. When `true`, the `Promise` is resolved with an array of `{ address: '1.2.3.4', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve IPv4 addresses (<code>A</code> records) for the\n<code>hostname</code>. On success, the <code>Promise</code> is resolved with an array of IPv4\naddresses (e.g. <code>['74.125.79.104', '74.125.79.105', '74.125.79.106']</code>).</p>"
            },
            {
              "textRaw": "`dnsPromises.resolve6(hostname[, options])`",
              "name": "resolve6",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string} Host name to resolve.",
                      "name": "hostname",
                      "type": "string",
                      "desc": "Host name to resolve."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record. When `true`, the `Promise` is resolved with an array of `{ address: '0:1:2:3:4:5:6:7', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds.",
                          "name": "ttl",
                          "type": "boolean",
                          "desc": "Retrieve the Time-To-Live value (TTL) of each record. When `true`, the `Promise` is resolved with an array of `{ address: '0:1:2:3:4:5:6:7', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve IPv6 addresses (<code>AAAA</code> records) for the\n<code>hostname</code>. On success, the <code>Promise</code> is resolved with an array of IPv6\naddresses.</p>"
            },
            {
              "textRaw": "`dnsPromises.resolveAny(hostname)`",
              "name": "resolveAny",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve all records (also known as <code>ANY</code> or <code>*</code> query).\nOn success, the <code>Promise</code> is resolved with an array containing various types of\nrecords. Each object has a property <code>type</code> that indicates the type of the\ncurrent record. And depending on the <code>type</code>, additional properties will be\npresent on the object:</p>\n<table>\n<thead>\n<tr>\n<th>Type</th>\n<th>Properties</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'A'</code></td>\n<td><code>address</code>/<code>ttl</code></td>\n</tr>\n<tr>\n<td><code>'AAAA'</code></td>\n<td><code>address</code>/<code>ttl</code></td>\n</tr>\n<tr>\n<td><code>'CAA'</code></td>\n<td>Refer to <a href=\"#dnspromisesresolvecaahostname\"><code>dnsPromises.resolveCaa()</code></a></td>\n</tr>\n<tr>\n<td><code>'CNAME'</code></td>\n<td><code>value</code></td>\n</tr>\n<tr>\n<td><code>'MX'</code></td>\n<td>Refer to <a href=\"#dnspromisesresolvemxhostname\"><code>dnsPromises.resolveMx()</code></a></td>\n</tr>\n<tr>\n<td><code>'NAPTR'</code></td>\n<td>Refer to <a href=\"#dnspromisesresolvenaptrhostname\"><code>dnsPromises.resolveNaptr()</code></a></td>\n</tr>\n<tr>\n<td><code>'NS'</code></td>\n<td><code>value</code></td>\n</tr>\n<tr>\n<td><code>'PTR'</code></td>\n<td><code>value</code></td>\n</tr>\n<tr>\n<td><code>'SOA'</code></td>\n<td>Refer to <a href=\"#dnspromisesresolvesoahostname\"><code>dnsPromises.resolveSoa()</code></a></td>\n</tr>\n<tr>\n<td><code>'SRV'</code></td>\n<td>Refer to <a href=\"#dnspromisesresolvesrvhostname\"><code>dnsPromises.resolveSrv()</code></a></td>\n</tr>\n<tr>\n<td><code>'TLSA'</code></td>\n<td>Refer to <a href=\"#dnspromisesresolvetlsahostname\"><code>dnsPromises.resolveTlsa()</code></a></td>\n</tr>\n<tr>\n<td><code>'TXT'</code></td>\n<td>This type of record contains an array property called <code>entries</code> which refers to <a href=\"#dnspromisesresolvetxthostname\"><code>dnsPromises.resolveTxt()</code></a>, e.g. <code>{ entries: ['...'], type: 'TXT' }</code></td>\n</tr>\n</tbody>\n</table>\n<p>Here is an example of the result object:</p>\n<pre><code class=\"language-js\">[ { type: 'A', address: '127.0.0.1', ttl: 299 },\n  { type: 'CNAME', value: 'example.com' },\n  { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 },\n  { type: 'NS', value: 'ns1.example.com' },\n  { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] },\n  { type: 'SOA',\n    nsname: 'ns1.example.com',\n    hostmaster: 'admin.example.com',\n    serial: 156696742,\n    refresh: 900,\n    retry: 900,\n    expire: 1800,\n    minttl: 60 } ]\n</code></pre>"
            },
            {
              "textRaw": "`dnsPromises.resolveCaa(hostname)`",
              "name": "resolveCaa",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0",
                  "v14.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve <code>CAA</code> records for the <code>hostname</code>. On success,\nthe <code>Promise</code> is resolved with an array of objects containing available\ncertification authority authorization records available for the <code>hostname</code>\n(e.g. <code>[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]</code>).</p>"
            },
            {
              "textRaw": "`dnsPromises.resolveCname(hostname)`",
              "name": "resolveCname",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve <code>CNAME</code> records for the <code>hostname</code>. On success,\nthe <code>Promise</code> is resolved with an array of canonical name records available for\nthe <code>hostname</code> (e.g. <code>['bar.example.com']</code>).</p>"
            },
            {
              "textRaw": "`dnsPromises.resolveMx(hostname)`",
              "name": "resolveMx",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve mail exchange records (<code>MX</code> records) for the\n<code>hostname</code>. On success, the <code>Promise</code> is resolved with an array of objects\ncontaining both a <code>priority</code> and <code>exchange</code> property (e.g.\n<code>[{priority: 10, exchange: 'mx.example.com'}, ...]</code>).</p>"
            },
            {
              "textRaw": "`dnsPromises.resolveNaptr(hostname)`",
              "name": "resolveNaptr",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve regular expression-based records (<code>NAPTR</code>\nrecords) for the <code>hostname</code>. On success, the <code>Promise</code> is resolved with an array\nof objects with the following properties:</p>\n<ul>\n<li><code>flags</code></li>\n<li><code>service</code></li>\n<li><code>regexp</code></li>\n<li><code>replacement</code></li>\n<li><code>order</code></li>\n<li><code>preference</code></li>\n</ul>\n<pre><code class=\"language-js\">{\n  flags: 's',\n  service: 'SIP+D2U',\n  regexp: '',\n  replacement: '_sip._udp.example.com',\n  order: 30,\n  preference: 100\n}\n</code></pre>"
            },
            {
              "textRaw": "`dnsPromises.resolveNs(hostname)`",
              "name": "resolveNs",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve name server records (<code>NS</code> records) for the\n<code>hostname</code>. On success, the <code>Promise</code> is resolved with an array of name server\nrecords available for <code>hostname</code> (e.g.\n<code>['ns1.example.com', 'ns2.example.com']</code>).</p>"
            },
            {
              "textRaw": "`dnsPromises.resolvePtr(hostname)`",
              "name": "resolvePtr",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve pointer records (<code>PTR</code> records) for the\n<code>hostname</code>. On success, the <code>Promise</code> is resolved with an array of strings\ncontaining the reply records.</p>"
            },
            {
              "textRaw": "`dnsPromises.resolveSoa(hostname)`",
              "name": "resolveSoa",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve a start of authority record (<code>SOA</code> record) for\nthe <code>hostname</code>. On success, the <code>Promise</code> is resolved with an object with the\nfollowing properties:</p>\n<ul>\n<li><code>nsname</code></li>\n<li><code>hostmaster</code></li>\n<li><code>serial</code></li>\n<li><code>refresh</code></li>\n<li><code>retry</code></li>\n<li><code>expire</code></li>\n<li><code>minttl</code></li>\n</ul>\n<pre><code class=\"language-js\">{\n  nsname: 'ns.example.com',\n  hostmaster: 'root.example.com',\n  serial: 2013101809,\n  refresh: 10000,\n  retry: 2400,\n  expire: 604800,\n  minttl: 3600\n}\n</code></pre>"
            },
            {
              "textRaw": "`dnsPromises.resolveSrv(hostname)`",
              "name": "resolveSrv",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve service records (<code>SRV</code> records) for the\n<code>hostname</code>. On success, the <code>Promise</code> is resolved with an array of objects with\nthe following properties:</p>\n<ul>\n<li><code>priority</code></li>\n<li><code>weight</code></li>\n<li><code>port</code></li>\n<li><code>name</code></li>\n</ul>\n<pre><code class=\"language-js\">{\n  priority: 10,\n  weight: 5,\n  port: 21223,\n  name: 'service.example.com'\n}\n</code></pre>"
            },
            {
              "textRaw": "`dnsPromises.resolveTlsa(hostname)`",
              "name": "resolveTlsa",
              "type": "method",
              "meta": {
                "added": [
                  "v23.9.0",
                  "v22.15.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve certificate associations (<code>TLSA</code> records) for\nthe <code>hostname</code>. On success, the <code>Promise</code> is resolved with an array of objects\nwith these properties:</p>\n<ul>\n<li><code>certUsage</code></li>\n<li><code>selector</code></li>\n<li><code>match</code></li>\n<li><code>data</code></li>\n</ul>\n<pre><code class=\"language-js\">{\n  certUsage: 3,\n  selector: 1,\n  match: 1,\n  data: [ArrayBuffer]\n}\n</code></pre>"
            },
            {
              "textRaw": "`dnsPromises.resolveTxt(hostname)`",
              "name": "resolveTxt",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve text queries (<code>TXT</code> records) for the\n<code>hostname</code>. On success, the <code>Promise</code> is resolved with a two-dimensional array\nof the text records available for <code>hostname</code> (e.g.\n<code>[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]</code>). Each sub-array contains TXT chunks of\none record. Depending on the use case, these could be either joined together or\ntreated separately.</p>"
            },
            {
              "textRaw": "`dnsPromises.reverse(ip)`",
              "name": "reverse",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`ip` {string}",
                      "name": "ip",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an\narray of host names.</p>\n<p>On error, the <code>Promise</code> is rejected with an <a href=\"errors.html#class-error\"><code>Error</code></a> object, where <code>err.code</code>\nis one of the <a href=\"#error-codes\">DNS error codes</a>.</p>"
            },
            {
              "textRaw": "`dnsPromises.setDefaultResultOrder(order)`",
              "name": "setDefaultResultOrder",
              "type": "method",
              "meta": {
                "added": [
                  "v16.4.0",
                  "v14.18.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.1.0",
                      "v20.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/52492",
                    "description": "The `ipv6first` value is supported now."
                  },
                  {
                    "version": "v17.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/39987",
                    "description": "Changed default value to `verbatim`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`order` {string} must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.",
                      "name": "order",
                      "type": "string",
                      "desc": "must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`."
                    }
                  ]
                }
              ],
              "desc": "<p>Set the default value of <code>order</code> in <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> and\n<a href=\"#dnspromiseslookuphostname-options\"><code>dnsPromises.lookup()</code></a>. The value could be:</p>\n<ul>\n<li><code>ipv4first</code>: sets default <code>order</code> to <code>ipv4first</code>.</li>\n<li><code>ipv6first</code>: sets default <code>order</code> to <code>ipv6first</code>.</li>\n<li><code>verbatim</code>: sets default <code>order</code> to <code>verbatim</code>.</li>\n</ul>\n<p>The default is <code>verbatim</code> and <a href=\"#dnspromisessetdefaultresultorderorder\"><code>dnsPromises.setDefaultResultOrder()</code></a> have\nhigher priority than <a href=\"cli.html#--dns-result-orderorder\"><code>--dns-result-order</code></a>. When using <a href=\"worker_threads.html\">worker threads</a>,\n<a href=\"#dnspromisessetdefaultresultorderorder\"><code>dnsPromises.setDefaultResultOrder()</code></a> from the main thread won't affect the\ndefault dns orders in workers.</p>"
            },
            {
              "textRaw": "`dnsPromises.getDefaultResultOrder()`",
              "name": "getDefaultResultOrder",
              "type": "method",
              "meta": {
                "added": [
                  "v20.1.0",
                  "v18.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Get the value of <code>dnsOrder</code>.</p>"
            },
            {
              "textRaw": "`dnsPromises.setServers(servers)`",
              "name": "setServers",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`servers` {string[]} array of RFC 5952 formatted addresses",
                      "name": "servers",
                      "type": "string[]",
                      "desc": "array of RFC 5952 formatted addresses"
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the IP address and port of servers to be used when performing DNS\nresolution. The <code>servers</code> argument is an array of <a href=\"https://tools.ietf.org/html/rfc5952#section-6\">RFC 5952</a> formatted\naddresses. If the port is the IANA default DNS port (53) it can be omitted.</p>\n<pre><code class=\"language-js\">dnsPromises.setServers([\n  '8.8.8.8',\n  '[2001:4860:4860::8888]',\n  '8.8.8.8:1053',\n  '[2001:4860:4860::8888]:1053',\n]);\n</code></pre>\n<p>An error will be thrown if an invalid address is provided.</p>\n<p>The <code>dnsPromises.setServers()</code> method must not be called while a DNS query is in\nprogress.</p>\n<p>This method works much like\n<a href=\"https://man7.org/linux/man-pages/man5/resolv.conf.5.html\">resolve.conf</a>.\nThat is, if attempting to resolve with the first server provided results in a\n<code>NOTFOUND</code> error, the <code>resolve()</code> method will <em>not</em> attempt to resolve with\nsubsequent servers provided. Fallback DNS servers will only be used if the\nearlier ones time out or result in some other error.</p>"
            }
          ],
          "displayName": "DNS promises API"
        },
        {
          "textRaw": "Error codes",
          "name": "error_codes",
          "type": "module",
          "desc": "<p>Each DNS query can return one of the following error codes:</p>\n<ul>\n<li><code>dns.NODATA</code>: DNS server returned an answer with no data.</li>\n<li><code>dns.FORMERR</code>: DNS server claims query was misformatted.</li>\n<li><code>dns.SERVFAIL</code>: DNS server returned general failure.</li>\n<li><code>dns.NOTFOUND</code>: Domain name not found.</li>\n<li><code>dns.NOTIMP</code>: DNS server does not implement the requested operation.</li>\n<li><code>dns.REFUSED</code>: DNS server refused query.</li>\n<li><code>dns.BADQUERY</code>: Misformatted DNS query.</li>\n<li><code>dns.BADNAME</code>: Misformatted host name.</li>\n<li><code>dns.BADFAMILY</code>: Unsupported address family.</li>\n<li><code>dns.BADRESP</code>: Misformatted DNS reply.</li>\n<li><code>dns.CONNREFUSED</code>: Could not contact DNS servers.</li>\n<li><code>dns.TIMEOUT</code>: Timeout while contacting DNS servers.</li>\n<li><code>dns.EOF</code>: End of file.</li>\n<li><code>dns.FILE</code>: Error reading file.</li>\n<li><code>dns.NOMEM</code>: Out of memory.</li>\n<li><code>dns.DESTRUCTION</code>: Channel is being destroyed.</li>\n<li><code>dns.BADSTR</code>: Misformatted string.</li>\n<li><code>dns.BADFLAGS</code>: Illegal flags specified.</li>\n<li><code>dns.NONAME</code>: Given host name is not numeric.</li>\n<li><code>dns.BADHINTS</code>: Illegal hints flags specified.</li>\n<li><code>dns.NOTINITIALIZED</code>: c-ares library initialization not yet performed.</li>\n<li><code>dns.LOADIPHLPAPI</code>: Error loading <code>iphlpapi.dll</code>.</li>\n<li><code>dns.ADDRGETNETWORKPARAMS</code>: Could not find <code>GetNetworkParams</code> function.</li>\n<li><code>dns.CANCELLED</code>: DNS query cancelled.</li>\n</ul>\n<p>The <code>dnsPromises</code> API also exports the above error codes, e.g., <code>dnsPromises.NODATA</code>.</p>",
          "displayName": "Error codes"
        },
        {
          "textRaw": "Implementation considerations",
          "name": "implementation_considerations",
          "type": "module",
          "desc": "<p>Although <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> and the various <code>dns.resolve*()/dns.reverse()</code>\nfunctions have the same goal of associating a network name with a network\naddress (or vice versa), their behavior is quite different. These differences\ncan have subtle but significant consequences on the behavior of Node.js\nprograms.</p>",
          "methods": [
            {
              "textRaw": "`dns.lookup()`",
              "name": "lookup",
              "type": "method",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Under the hood, <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> uses the same operating system facilities\nas most other programs. For instance, <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> will almost always\nresolve a given name the same way as the <code>ping</code> command. On most POSIX-like\noperating systems, the behavior of the <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> function can be\nmodified by changing settings in <a href=\"http://man7.org/linux/man-pages/man5/nsswitch.conf.5.html\"><code>nsswitch.conf(5)</code></a> and/or <a href=\"http://man7.org/linux/man-pages/man5/resolv.conf.5.html\"><code>resolv.conf(5)</code></a>,\nbut changing these files will change the behavior of all other\nprograms running on the same operating system.</p>\n<p>Though the call to <code>dns.lookup()</code> will be asynchronous from JavaScript's\nperspective, it is implemented as a synchronous call to <a href=\"http://man7.org/linux/man-pages/man3/getaddrinfo.3.html\"><code>getaddrinfo(3)</code></a> that runs\non libuv's threadpool. This can have surprising negative performance\nimplications for some applications, see the <a href=\"cli.html#uv_threadpool_sizesize\"><code>UV_THREADPOOL_SIZE</code></a>\ndocumentation for more information.</p>\n<p>Various networking APIs will call <code>dns.lookup()</code> internally to resolve\nhost names. If that is an issue, consider resolving the host name to an address\nusing <code>dns.resolve()</code> and using the address instead of a host name. Also, some\nnetworking APIs (such as <a href=\"net.html#socketconnectoptions-connectlistener\"><code>socket.connect()</code></a> and <a href=\"dgram.html#dgramcreatesocketoptions-callback\"><code>dgram.createSocket()</code></a>)\nallow the default resolver, <code>dns.lookup()</code>, to be replaced.</p>"
            }
          ],
          "modules": [
            {
              "textRaw": "`dns.resolve()`, `dns.resolve*()`, and `dns.reverse()`",
              "name": "`dns.resolve()`,_`dns.resolve*()`,_and_`dns.reverse()`",
              "type": "module",
              "desc": "<p>These functions are implemented quite differently than <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a>. They\ndo not use <a href=\"http://man7.org/linux/man-pages/man3/getaddrinfo.3.html\"><code>getaddrinfo(3)</code></a> and they <em>always</em> perform a DNS query on the\nnetwork. This network communication is always done asynchronously and does not\nuse libuv's threadpool.</p>\n<p>As a result, these functions cannot have the same negative impact on other\nprocessing that happens on libuv's threadpool that <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> can have.</p>\n<p>They do not use the same set of configuration files that <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a>\nuses. For instance, they do not use the configuration from <code>/etc/hosts</code>.</p>",
              "displayName": "`dns.resolve()`, `dns.resolve*()`, and `dns.reverse()`"
            }
          ],
          "displayName": "Implementation considerations"
        }
      ],
      "displayName": "DNS"
    }
  ]
}