From b63b65cc2b0e602e2e9bbd73f1f8ef6034808753 Mon Sep 17 00:00:00 2001 From: 0xSanyam <108138884+0xSanyam@users.noreply.github.com> Date: Thu, 7 Jul 2022 03:46:00 +0530 Subject: [PATCH] doc: improve readability of `dns.md` PR-URL: https://github.com/nodejs/node/pull/43694 Reviewed-By: Matteo Collina Reviewed-By: Benjamin Gruenbaum Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Harshitha K P --- doc/api/dns.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/api/dns.md b/doc/api/dns.md index 72d57e4f7e2f41..53040860538e6d 100644 --- a/doc/api/dns.md +++ b/doc/api/dns.md @@ -140,7 +140,7 @@ The resolver instance will send its requests from the specified IP address. This allows programs to specify outbound interfaces when used on multi-homed systems. -If a v4 or v6 address is not specified, it is set to the default, and the +If a v4 or v6 address is not specified, it is set to the default and the operating system will choose a local address automatically. The resolver will use the v4 local address when making requests to IPv4 DNS @@ -222,7 +222,7 @@ such as no available file descriptors. `dns.lookup()` does not necessarily have anything to do with the DNS protocol. The implementation uses an operating system facility that can associate names -with addresses, and vice versa. This implementation can have subtle but +with addresses and vice versa. This implementation can have subtle but important consequences on the behavior of any Node.js program. Please take some time to consult the [Implementation considerations section][] before using `dns.lookup()`. @@ -268,7 +268,7 @@ The following flags can be passed as hints to [`dns.lookup()`][]. returned if the current system has at least one IPv4 address configured. * `dns.V4MAPPED`: If the IPv6 family was specified, but no IPv6 addresses were found, then return IPv4 mapped IPv6 addresses. It is not supported - on some operating systems (e.g FreeBSD 10.1). + on some operating systems (e.g. FreeBSD 10.1). * `dns.ALL`: If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as well as IPv4 mapped IPv6 addresses. @@ -353,7 +353,7 @@ changes: * `hostname` {string} Host name to resolve. * `options` {Object} - * `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record. + * `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. @@ -387,7 +387,7 @@ changes: * `err` {Error} * `addresses` {string\[] | Object\[]} -Uses the DNS protocol to resolve a IPv6 addresses (`AAAA` records) for the +Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. The `addresses` argument passed to the `callback` function will contain an array of IPv6 addresses. @@ -501,7 +501,7 @@ added: v0.9.12 * `err` {Error} * `addresses` {Object\[]} -Uses the DNS protocol to resolve regular expression based records (`NAPTR` +Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. The `addresses` argument passed to the `callback` function will contain an array of objects with the following properties: @@ -793,7 +793,7 @@ added: v15.3.0 --> Cancel all outstanding DNS queries made by this resolver. The corresponding -promises will be rejected with an error with code `ECANCELLED`. +promises will be rejected with an error with the code `ECANCELLED`. ### `dnsPromises.getServers()` @@ -857,7 +857,7 @@ such as no available file descriptors. [`dnsPromises.lookup()`][] does not necessarily have anything to do with the DNS protocol. The implementation uses an operating system facility that can -associate names with addresses, and vice versa. This implementation can have +associate names with addresses and vice versa. This implementation can have subtle but important consequences on the behavior of any Node.js program. Please take some time to consult the [Implementation considerations section][] before using `dnsPromises.lookup()`. @@ -1072,7 +1072,7 @@ added: v10.6.0 * `hostname` {string} -Uses the DNS protocol to resolve regular expression based records (`NAPTR` +Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects with the following properties: @@ -1268,11 +1268,11 @@ earlier ones time out or result in some other error. Each DNS query can return one of the following error codes: -* `dns.NODATA`: DNS server returned answer with no data. +* `dns.NODATA`: DNS server returned an answer with no data. * `dns.FORMERR`: DNS server claims query was misformatted. * `dns.SERVFAIL`: DNS server returned general failure. * `dns.NOTFOUND`: Domain name not found. -* `dns.NOTIMP`: DNS server does not implement requested operation. +* `dns.NOTIMP`: DNS server does not implement the requested operation. * `dns.REFUSED`: DNS server refused query. * `dns.BADQUERY`: Misformatted DNS query. * `dns.BADNAME`: Misformatted host name. @@ -1293,7 +1293,7 @@ Each DNS query can return one of the following error codes: * `dns.ADDRGETNETWORKPARAMS`: Could not find `GetNetworkParams` function. * `dns.CANCELLED`: DNS query cancelled. -The above error codes are also exported by the `dnsPromises` API, e.g., `dnsPromises.NODATA`. +The `dnsPromises` API also exports the above error codes, e.g., `dnsPromises.NODATA`. ## Implementation considerations @@ -1329,7 +1329,7 @@ allow the default resolver, `dns.lookup()`, to be replaced. These functions are implemented quite differently than [`dns.lookup()`][]. They do not use getaddrinfo(3) and they _always_ perform a DNS query on the -network. This network communication is always done asynchronously, and does not +network. This network communication is always done asynchronously and does not use libuv's threadpool. As a result, these functions cannot have the same negative impact on other