Browse Source

doc: add `added:` information for dns

Got the information from git history and I ignored previous version of
dns attached to `node.dns` (pre v0.1.16).

There is a case where `dns.resolveNaptr` were intented to be in v0.7.12 and
it was reverted and addec back on `v0.9.12`, I left the latest version
when module was introduced. Same for `dns.resolvePtr` who was referenced
before but it was only added on `v6.0.0`

Refs: https://github.com/nodejs/node/issues/6578
PR-URL: https://github.com/nodejs/node/pull/7021
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
v4.x
Julian Duque 9 years ago
committed by Myles Borins
parent
commit
1d99059bb1
  1. 45
      doc/api/dns.md

45
doc/api/dns.md

@ -54,11 +54,17 @@ There are subtle consequences in choosing one over the other, please consult
the [Implementation considerations section][] for more information. the [Implementation considerations section][] for more information.
## dns.getServers() ## dns.getServers()
<!-- YAML
added: v0.11.3
-->
Returns an array of IP address strings that are being used for name Returns an array of IP address strings that are being used for name
resolution. resolution.
## dns.lookup(hostname[, options], callback) ## dns.lookup(hostname[, options], callback)
<!-- YAML
added: v0.1.90
-->
Resolves a hostname (e.g. `'nodejs.org'`) into the first found A (IPv4) or Resolves a hostname (e.g. `'nodejs.org'`) into the first found A (IPv4) or
AAAA (IPv6) record. `options` can be an object or integer. If `options` is AAAA (IPv6) record. `options` can be an object or integer. If `options` is
@ -122,6 +128,9 @@ found, then return IPv4 mapped IPv6 addresses. Note that it is not supported
on some operating systems (e.g FreeBSD 10.1). on some operating systems (e.g FreeBSD 10.1).
## dns.lookupService(address, port, callback) ## dns.lookupService(address, port, callback)
<!-- YAML
added: v0.11.14
-->
Resolves the given `address` and `port` into a hostname and service using Resolves the given `address` and `port` into a hostname and service using
the operating system's underlying `getnameinfo` implementation. the operating system's underlying `getnameinfo` implementation.
@ -140,6 +149,9 @@ dns.lookupService('127.0.0.1', 22, (err, hostname, service) => {
``` ```
## dns.resolve(hostname[, rrtype], callback) ## dns.resolve(hostname[, rrtype], callback)
<!-- YAML
added: v0.1.27
-->
Uses the DNS protocol to resolve a hostname (e.g. `'nodejs.org'`) into an Uses the DNS protocol to resolve a hostname (e.g. `'nodejs.org'`) into an
array of the record types specified by `rrtype`. array of the record types specified by `rrtype`.
@ -168,6 +180,9 @@ On error, `err` is an [`Error`][] object, where `err.code` is
one of the error codes listed [here](#dns_error_codes). one of the error codes listed [here](#dns_error_codes).
## dns.resolve4(hostname, callback) ## dns.resolve4(hostname, callback)
<!-- YAML
added: v0.1.16
-->
Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the
`hostname`. The `addresses` argument passed to the `callback` function `hostname`. The `addresses` argument passed to the `callback` function
@ -175,12 +190,18 @@ will contain an array of IPv4 addresses (e.g.
`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
## dns.resolve6(hostname, callback) ## dns.resolve6(hostname, callback)
<!-- YAML
added: v0.1.16
-->
Uses the DNS protocol to resolve a IPv6 addresses (`AAAA` records) for the Uses the DNS protocol to resolve a IPv6 addresses (`AAAA` records) for the
`hostname`. The `addresses` argument passed to the `callback` function `hostname`. The `addresses` argument passed to the `callback` function
will contain an array of IPv6 addresses. will contain an array of IPv6 addresses.
## dns.resolveCname(hostname, callback) ## dns.resolveCname(hostname, callback)
<!-- YAML
added: v0.3.2
-->
Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The
`addresses` argument passed to the `callback` function `addresses` argument passed to the `callback` function
@ -188,6 +209,9 @@ will contain an array of canonical name records available for the `hostname`
(e.g. `['bar.example.com']`). (e.g. `['bar.example.com']`).
## dns.resolveMx(hostname, callback) ## dns.resolveMx(hostname, callback)
<!-- YAML
added: v0.1.27
-->
Uses the DNS protocol to resolve mail exchange records (`MX` records) for the Uses the DNS protocol to resolve mail exchange records (`MX` records) for the
`hostname`. The `addresses` argument passed to the `callback` function will `hostname`. The `addresses` argument passed to the `callback` function will
@ -195,6 +219,9 @@ contain an array of objects containing both a `priority` and `exchange`
property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`).
## dns.resolveNaptr(hostname, callback) ## dns.resolveNaptr(hostname, callback)
<!-- YAML
added: v0.9.12
-->
Uses the DNS protocol to resolve regular expression based records (`NAPTR` Uses the DNS protocol to resolve regular expression based records (`NAPTR`
records) for the `hostname`. The `callback` function has arguments records) for the `hostname`. The `callback` function has arguments
@ -222,6 +249,9 @@ For example:
``` ```
## dns.resolveNs(hostname, callback) ## dns.resolveNs(hostname, callback)
<!-- YAML
added: v0.1.90
-->
Uses the DNS protocol to resolve name server records (`NS` records) for the Uses the DNS protocol to resolve name server records (`NS` records) for the
`hostname`. The `addresses` argument passed to the `callback` function will `hostname`. The `addresses` argument passed to the `callback` function will
@ -229,6 +259,9 @@ contain an array of name server records available for `hostname`
(e.g., `['ns1.example.com', 'ns2.example.com']`). (e.g., `['ns1.example.com', 'ns2.example.com']`).
## dns.resolveSoa(hostname, callback) ## dns.resolveSoa(hostname, callback)
<!-- YAML
added: v0.11.10
-->
Uses the DNS protocol to resolve a start of authority record (`SOA` record) for Uses the DNS protocol to resolve a start of authority record (`SOA` record) for
the `hostname`. The `addresses` argument passed to the `callback` function will the `hostname`. The `addresses` argument passed to the `callback` function will
@ -255,6 +288,9 @@ be an object with the following properties:
``` ```
## dns.resolveSrv(hostname, callback) ## dns.resolveSrv(hostname, callback)
<!-- YAML
added: v0.1.27
-->
Uses the DNS protocol to resolve service records (`SRV` records) for the Uses the DNS protocol to resolve service records (`SRV` records) for the
`hostname`. The `addresses` argument passed to the `callback` function will `hostname`. The `addresses` argument passed to the `callback` function will
@ -275,6 +311,9 @@ be an array of objects with the following properties:
``` ```
## dns.resolveTxt(hostname, callback) ## dns.resolveTxt(hostname, callback)
<!-- YAML
added: v0.1.27
-->
Uses the DNS protocol to resolve text queries (`TXT` records) for the Uses the DNS protocol to resolve text queries (`TXT` records) for the
`hostname`. The `addresses` argument passed to the `callback` function is `hostname`. The `addresses` argument passed to the `callback` function is
@ -284,6 +323,9 @@ one record. Depending on the use case, these could be either joined together or
treated separately. treated separately.
## dns.reverse(ip, callback) ## dns.reverse(ip, callback)
<!-- YAML
added: v0.1.16
-->
Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
array of hostnames. array of hostnames.
@ -295,6 +337,9 @@ On error, `err` is an [`Error`][] object, where `err.code` is
one of the [DNS error codes][]. one of the [DNS error codes][].
## dns.setServers(servers) ## dns.setServers(servers)
<!-- YAML
added: v0.11.3
-->
Sets the IP addresses of the servers to be used when resolving. The `servers` Sets the IP addresses of the servers to be used when resolving. The `servers`
argument is an array of IPv4 or IPv6 addresses. argument is an array of IPv4 or IPv6 addresses.

Loading…
Cancel
Save