Skip to content

Commit

Permalink
doc: dns.resolve fix callback argument description
Browse files Browse the repository at this point in the history
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 <anna@addaleax.net>
Reviewed-By: Roman Reiss <me@silverwind.io>
  • Loading branch information
qheaden authored and MylesBorins committed Jul 12, 2016
1 parent 714aee2 commit 8c929aa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doc/api/dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ Valid values for `rrtype` are:
* `'NAPTR'` - name authority pointer record

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

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

0 comments on commit 8c929aa

Please sign in to comment.