Skip to content

Commit de5e235

Browse files
qheadenMyles Borins
authored and
Myles Borins
committed
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 0f903bb commit de5e235

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
@@ -158,7 +158,9 @@ Valid values for `rrtype` are:
158158
* `'NAPTR'` - name authority pointer record
159159

160160
The `callback` function has arguments `(err, addresses)`. When successful,
161-
`addresses` will be an array. The type of each item in `addresses` is
161+
`addresses` will be an array, except when resolving an SOA record which returns
162+
an object structured in the same manner as one returned by the
163+
[`dns.resolveSoa()`][] method. The type of each item in `addresses` is
162164
determined by the record type, and described in the documentation for the
163165
corresponding lookup methods.
164166

@@ -379,6 +381,7 @@ uses. For instance, _they do not use the configuration from `/etc/hosts`_.
379381
[`dns.lookup()`]: #dns_dns_lookup_hostname_options_callback
380382
[`dns.resolve()`]: #dns_dns_resolve_hostname_rrtype_callback
381383
[`dns.resolve4()`]: #dns_dns_resolve4_hostname_callback
384+
[`dns.resolveSoa()`]: #dns_dns_resolvesoa_hostname_callback
382385
[`Error`]: errors.html#errors_class_error
383386
[Implementation considerations section]: #dns_implementation_considerations
384387
[supported `getaddrinfo` flags]: #dns_supported_getaddrinfo_flags

0 commit comments

Comments
 (0)