Skip to content

Commit a81ff70

Browse files
qheadenevanlucas
authored andcommitted
doc: dns.resolve fix callback argument description
The dns.resolve documentation stated that an array of IP addresses would be returned in the callback. This is true for everything other than the SOA record which returns an object. This fixes that documentation. Fixes: #6506 PR-URL: #7532 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
1 parent 9797969 commit a81ff70

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

doc/api/dns.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ Valid values for `rrtype` are:
174174
* `'NAPTR'` - name authority pointer record
175175

176176
The `callback` function has arguments `(err, addresses)`. When successful,
177-
`addresses` will be an array. The type of each item in `addresses` is
177+
`addresses` will be an array, except when resolving an SOA record which returns
178+
an object structured in the same manner as one returned by the
179+
[`dns.resolveSoa()`][] method. The type of each item in `addresses` is
178180
determined by the record type, and described in the documentation for the
179181
corresponding lookup methods.
180182

@@ -437,6 +439,7 @@ uses. For instance, _they do not use the configuration from `/etc/hosts`_.
437439
[`dns.lookup()`]: #dns_dns_lookup_hostname_options_callback
438440
[`dns.resolve()`]: #dns_dns_resolve_hostname_rrtype_callback
439441
[`dns.resolve4()`]: #dns_dns_resolve4_hostname_callback
442+
[`dns.resolveSoa()`]: #dns_dns_resolvesoa_hostname_callback
440443
[`Error`]: errors.html#errors_class_error
441444
[Implementation considerations section]: #dns_implementation_considerations
442445
[supported `getaddrinfo` flags]: #dns_supported_getaddrinfo_flags

0 commit comments

Comments
 (0)