Skip to content

Commit 18ec135

Browse files
0xSanyamguangwong
authored andcommitted
doc: improve readability of dns.md
PR-URL: nodejs/node#43694 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Harshitha K P <[email protected]>
1 parent 14b44f2 commit 18ec135

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

doc/api/dns.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ The resolver instance will send its requests from the specified IP address.
140140
This allows programs to specify outbound interfaces when used on multi-homed
141141
systems.
142142

143-
If a v4 or v6 address is not specified, it is set to the default, and the
143+
If a v4 or v6 address is not specified, it is set to the default and the
144144
operating system will choose a local address automatically.
145145

146146
The resolver will use the v4 local address when making requests to IPv4 DNS
@@ -222,7 +222,7 @@ such as no available file descriptors.
222222

223223
`dns.lookup()` does not necessarily have anything to do with the DNS protocol.
224224
The implementation uses an operating system facility that can associate names
225-
with addresses, and vice versa. This implementation can have subtle but
225+
with addresses and vice versa. This implementation can have subtle but
226226
important consequences on the behavior of any Node.js program. Please take some
227227
time to consult the [Implementation considerations section][] before using
228228
`dns.lookup()`.
@@ -268,7 +268,7 @@ The following flags can be passed as hints to [`dns.lookup()`][].
268268
returned if the current system has at least one IPv4 address configured.
269269
* `dns.V4MAPPED`: If the IPv6 family was specified, but no IPv6 addresses were
270270
found, then return IPv4 mapped IPv6 addresses. It is not supported
271-
on some operating systems (e.g FreeBSD 10.1).
271+
on some operating systems (e.g. FreeBSD 10.1).
272272
* `dns.ALL`: If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as
273273
well as IPv4 mapped IPv6 addresses.
274274

@@ -353,7 +353,7 @@ changes:
353353

354354
* `hostname` {string} Host name to resolve.
355355
* `options` {Object}
356-
* `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record.
356+
* `ttl` {boolean} Retrieves the Time-To-Live value (TTL) of each record.
357357
When `true`, the callback receives an array of
358358
`{ address: '1.2.3.4', ttl: 60 }` objects rather than an array of strings,
359359
with the TTL expressed in seconds.
@@ -387,7 +387,7 @@ changes:
387387
* `err` {Error}
388388
* `addresses` {string\[] | Object\[]}
389389

390-
Uses the DNS protocol to resolve a IPv6 addresses (`AAAA` records) for the
390+
Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the
391391
`hostname`. The `addresses` argument passed to the `callback` function
392392
will contain an array of IPv6 addresses.
393393

@@ -501,7 +501,7 @@ added: v0.9.12
501501
* `err` {Error}
502502
* `addresses` {Object\[]}
503503

504-
Uses the DNS protocol to resolve regular expression based records (`NAPTR`
504+
Uses the DNS protocol to resolve regular expression-based records (`NAPTR`
505505
records) for the `hostname`. The `addresses` argument passed to the `callback`
506506
function will contain an array of objects with the following properties:
507507

@@ -793,7 +793,7 @@ added: v15.3.0
793793
-->
794794

795795
Cancel all outstanding DNS queries made by this resolver. The corresponding
796-
promises will be rejected with an error with code `ECANCELLED`.
796+
promises will be rejected with an error with the code `ECANCELLED`.
797797

798798
### `dnsPromises.getServers()`
799799

@@ -857,7 +857,7 @@ such as no available file descriptors.
857857

858858
[`dnsPromises.lookup()`][] does not necessarily have anything to do with the DNS
859859
protocol. The implementation uses an operating system facility that can
860-
associate names with addresses, and vice versa. This implementation can have
860+
associate names with addresses and vice versa. This implementation can have
861861
subtle but important consequences on the behavior of any Node.js program. Please
862862
take some time to consult the [Implementation considerations section][] before
863863
using `dnsPromises.lookup()`.
@@ -1072,7 +1072,7 @@ added: v10.6.0
10721072

10731073
* `hostname` {string}
10741074

1075-
Uses the DNS protocol to resolve regular expression based records (`NAPTR`
1075+
Uses the DNS protocol to resolve regular expression-based records (`NAPTR`
10761076
records) for the `hostname`. On success, the `Promise` is resolved with an array
10771077
of objects with the following properties:
10781078

@@ -1268,11 +1268,11 @@ earlier ones time out or result in some other error.
12681268

12691269
Each DNS query can return one of the following error codes:
12701270

1271-
* `dns.NODATA`: DNS server returned answer with no data.
1271+
* `dns.NODATA`: DNS server returned an answer with no data.
12721272
* `dns.FORMERR`: DNS server claims query was misformatted.
12731273
* `dns.SERVFAIL`: DNS server returned general failure.
12741274
* `dns.NOTFOUND`: Domain name not found.
1275-
* `dns.NOTIMP`: DNS server does not implement requested operation.
1275+
* `dns.NOTIMP`: DNS server does not implement the requested operation.
12761276
* `dns.REFUSED`: DNS server refused query.
12771277
* `dns.BADQUERY`: Misformatted DNS query.
12781278
* `dns.BADNAME`: Misformatted host name.
@@ -1293,7 +1293,7 @@ Each DNS query can return one of the following error codes:
12931293
* `dns.ADDRGETNETWORKPARAMS`: Could not find `GetNetworkParams` function.
12941294
* `dns.CANCELLED`: DNS query cancelled.
12951295

1296-
The above error codes are also exported by the `dnsPromises` API, e.g., `dnsPromises.NODATA`.
1296+
The `dnsPromises` API also exports the above error codes, e.g., `dnsPromises.NODATA`.
12971297

12981298
## Implementation considerations
12991299

@@ -1329,7 +1329,7 @@ allow the default resolver, `dns.lookup()`, to be replaced.
13291329

13301330
These functions are implemented quite differently than [`dns.lookup()`][]. They
13311331
do not use getaddrinfo(3) and they _always_ perform a DNS query on the
1332-
network. This network communication is always done asynchronously, and does not
1332+
network. This network communication is always done asynchronously and does not
13331333
use libuv's threadpool.
13341334

13351335
As a result, these functions cannot have the same negative impact on other

0 commit comments

Comments
 (0)