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 12, 2022
1 parent ca0fbfd commit d46261c
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 @@ -144,7 +144,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 @@ -239,7 +239,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 @@ -285,7 +285,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 @@ -387,7 +387,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 @@ -426,7 +426,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 @@ -575,7 +575,7 @@ changes:
* `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 @@ -901,7 +901,7 @@ added:
-->

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 @@ -965,7 +965,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 @@ -1182,7 +1182,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 @@ -1380,11 +1380,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 @@ -1405,7 +1405,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 @@ -1441,7 +1441,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 d46261c

Please sign in to comment.