Skip to content

Commit

Permalink
doc: improve readability of dns.md
Browse files Browse the repository at this point in the history
PR-URL: #43694
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Harshitha K P <harshitha014@gmail.com>
  • Loading branch information
0xSanyam authored and targos committed Jul 31, 2022
1 parent a8980b2 commit c941798
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions doc/api/dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()`.
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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()`

Expand Down Expand Up @@ -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()`.
Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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.
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c941798

Please sign in to comment.