@@ -54,6 +54,11 @@ There are subtle consequences in choosing one or another, please consult the
54
54
[ Implementation considerations section] ( #dns_implementation_considerations )
55
55
for more information.
56
56
57
+ ## dns.getServers()
58
+
59
+ Returns an array of IP addresses as strings that are currently being used for
60
+ resolution
61
+
57
62
## dns.lookup(hostname[ , options] , callback)
58
63
59
64
Resolves a hostname (e.g. ` 'google.com' ` ) into the first found A (IPv4) or
@@ -152,6 +157,11 @@ The same as [`dns.resolve()`](#dns_dns_resolve_hostname_rrtype_callback), but on
152
157
153
158
The same as [ ` dns.resolve4() ` ] ( #dns_dns_resolve4_hostname_callback ) except for IPv6 queries (an ` AAAA ` query).
154
159
160
+ ## dns.resolveCname(hostname, callback)
161
+
162
+ The same as [ ` dns.resolve() ` ] ( #dns_dns_resolve_hostname_rrtype_callback ) , but only for canonical name records (` CNAME `
163
+ records). ` addresses ` is an array of the canonical name records available for
164
+ ` hostname ` (e.g., ` ['bar.example.com'] ` ).
155
165
156
166
## dns.resolveMx(hostname, callback)
157
167
@@ -160,20 +170,11 @@ The same as [`dns.resolve()`](#dns_dns_resolve_hostname_rrtype_callback), but on
160
170
` addresses ` is an array of MX records, each with a priority and an exchange
161
171
attribute (e.g. ` [{'priority': 10, 'exchange': 'mx.example.com'},...] ` ).
162
172
163
- ## dns.resolveTxt(hostname, callback)
164
-
165
- The same as [ ` dns.resolve() ` ] ( #dns_dns_resolve_hostname_rrtype_callback ) , but only for text queries (` TXT ` records).
166
- ` addresses ` is a 2-d array of the text records available for ` hostname ` (e.g.,
167
- ` [ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ] ` ). Each sub-array contains TXT chunks of
168
- one record. Depending on the use case, the could be either joined together or
169
- treated separately.
170
-
171
- ## dns.resolveSrv(hostname, callback)
173
+ ## dns.resolveNs(hostname, callback)
172
174
173
- The same as [ ` dns.resolve() ` ] ( #dns_dns_resolve_hostname_rrtype_callback ) , but only for service records (` SRV ` records).
174
- ` addresses ` is an array of the SRV records available for ` hostname ` . Properties
175
- of SRV records are priority, weight, port, and name (e.g.,
176
- ` [{'priority': 10, 'weight': 5, 'port': 21223, 'name': 'service.example.com'}, ...] ` ).
175
+ The same as [ ` dns.resolve() ` ] ( #dns_dns_resolve_hostname_rrtype_callback ) , but only for name server records (` NS ` records).
176
+ ` addresses ` is an array of the name server records available for ` hostname `
177
+ (e.g., ` ['ns1.example.com', 'ns2.example.com'] ` ).
177
178
178
179
## dns.resolveSoa(hostname, callback)
179
180
@@ -194,17 +195,20 @@ The same as [`dns.resolve()`](#dns_dns_resolve_hostname_rrtype_callback), but on
194
195
}
195
196
```
196
197
197
- ## dns.resolveNs (hostname, callback)
198
+ ## dns.resolveSrv (hostname, callback)
198
199
199
- The same as [ ` dns.resolve() ` ] ( #dns_dns_resolve_hostname_rrtype_callback ) , but only for name server records (` NS ` records).
200
- ` addresses ` is an array of the name server records available for ` hostname `
201
- (e.g., ` ['ns1.example.com', 'ns2.example.com'] ` ).
200
+ The same as [ ` dns.resolve() ` ] ( #dns_dns_resolve_hostname_rrtype_callback ) , but only for service records (` SRV ` records).
201
+ ` addresses ` is an array of the SRV records available for ` hostname ` . Properties
202
+ of SRV records are priority, weight, port, and name (e.g.,
203
+ ` [{'priority': 10, 'weight': 5, 'port': 21223, 'name': 'service.example.com'}, ...] ` ).
202
204
203
- ## dns.resolveCname (hostname, callback)
205
+ ## dns.resolveTxt (hostname, callback)
204
206
205
- The same as [ ` dns.resolve() ` ] ( #dns_dns_resolve_hostname_rrtype_callback ) , but only for canonical name records (` CNAME `
206
- records). ` addresses ` is an array of the canonical name records available for
207
- ` hostname ` (e.g., ` ['bar.example.com'] ` ).
207
+ The same as [ ` dns.resolve() ` ] ( #dns_dns_resolve_hostname_rrtype_callback ) , but only for text queries (` TXT ` records).
208
+ ` addresses ` is a 2-d array of the text records available for ` hostname ` (e.g.,
209
+ ` [ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ] ` ). Each sub-array contains TXT chunks of
210
+ one record. Depending on the use case, the could be either joined together or
211
+ treated separately.
208
212
209
213
## dns.reverse(ip, callback)
210
214
@@ -215,11 +219,6 @@ The callback has arguments `(err, hostnames)`.
215
219
On error, ` err ` is an ` Error ` object, where ` err.code ` is
216
220
one of the error codes listed below.
217
221
218
- ## dns.getServers()
219
-
220
- Returns an array of IP addresses as strings that are currently being used for
221
- resolution
222
-
223
222
## dns.setServers(servers)
224
223
225
224
Given an array of IP addresses as strings, set them as the servers to use for
@@ -314,4 +313,4 @@ They do not use the same set of configuration files than what `dns.lookup()`
314
313
uses. For instance, _ they do not use the configuration from ` /etc/hosts ` _ .
315
314
316
315
317
- [ dns.lookup ] : #dns_dns_lookup_hostname_options_callback
316
+ [ dns.lookup ] : #dns_dns_lookup_hostname_options_callback
0 commit comments