Skip to content

Commit f5fc412

Browse files
Shivang44targos
authored andcommitted
doc: clarify setServers() methods in dns.md
Added a note that that clarifies the fact that setServers() does not check subsequent servers when the first one produces a NOTFOUND error. PR-URL: #21469 Refs: #21391 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 4647f61 commit f5fc412

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

doc/api/dns.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,13 @@ An error will be thrown if an invalid address is provided.
568568
The `dns.setServers()` method must not be called while a DNS query is in
569569
progress.
570570

571+
Note that this method works much like
572+
[resolve.conf](http://man7.org/linux/man-pages/man5/resolv.conf.5.html).
573+
That is, if attempting to resolve with the first server provided results in a
574+
`NOTFOUND` error, the `resolve()` method will *not* attempt to resolve with
575+
subsequent servers provided. Fallback DNS servers will only be used if the
576+
earlier ones time out or result in some other error.
577+
571578
## DNS Promises API
572579

573580
> Stability: 1 - Experimental
@@ -1010,6 +1017,13 @@ An error will be thrown if an invalid address is provided.
10101017
The `dnsPromises.setServers()` method must not be called while a DNS query is in
10111018
progress.
10121019

1020+
Note that this method works much like
1021+
[resolve.conf](http://man7.org/linux/man-pages/man5/resolv.conf.5.html).
1022+
That is, if attempting to resolve with the first server provided results in a
1023+
`NOTFOUND` error, the `resolve()` method will *not* attempt to resolve with
1024+
subsequent servers provided. Fallback DNS servers will only be used if the
1025+
earlier ones time out or result in some other error.
1026+
10131027
## Error codes
10141028

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

0 commit comments

Comments
 (0)