@@ -21,19 +21,19 @@ resolves the IP addresses which are returned.
21
21
console.log('addresses: ' + JSON.stringify(addresses));
22
22
23
23
addresses.forEach(function (a) {
24
- dns.reverse(a, function (err, domains ) {
24
+ dns.reverse(a, function (err, hostnames ) {
25
25
if (err) {
26
26
throw err;
27
27
}
28
28
29
- console.log('reverse for ' + a + ': ' + JSON.stringify(domains ));
29
+ console.log('reverse for ' + a + ': ' + JSON.stringify(hostnames ));
30
30
});
31
31
});
32
32
});
33
33
34
- ## dns.lookup(domain , [ family] , callback)
34
+ ## dns.lookup(hostname , [ family] , callback)
35
35
36
- Resolves a domain (e.g. ` 'google.com' ` ) into the first found A (IPv4) or
36
+ Resolves a hostname (e.g. ` 'google.com' ` ) into the first found A (IPv4) or
37
37
AAAA (IPv6) record.
38
38
The ` family ` can be the integer ` 4 ` or ` 6 ` . Defaults to ` null ` that indicates
39
39
both Ip v4 and v6 address family.
@@ -45,13 +45,13 @@ necessarily the value initially passed to `lookup`).
45
45
46
46
On error, ` err ` is an ` Error ` object, where ` err.code ` is the error code.
47
47
Keep in mind that ` err.code ` will be set to ` 'ENOENT' ` not only when
48
- the domain does not exist but also when the lookup fails in other ways
48
+ the hostname does not exist but also when the lookup fails in other ways
49
49
such as no available file descriptors.
50
50
51
51
52
- ## dns.resolve(domain , [ rrtype] , callback)
52
+ ## dns.resolve(hostname , [ rrtype] , callback)
53
53
54
- Resolves a domain (e.g. ` 'google.com' ` ) into an array of the record types
54
+ Resolves a hostname (e.g. ` 'google.com' ` ) into an array of the record types
55
55
specified by rrtype. Valid rrtypes are ` 'A' ` (IPV4 addresses, default),
56
56
` 'AAAA' ` (IPV6 addresses), ` 'MX' ` (mail exchange records), ` 'TXT' ` (text
57
57
records), ` 'SRV' ` (SRV records), ` 'PTR' ` (used for reverse IP lookups),
@@ -65,54 +65,54 @@ On error, `err` is an `Error` object, where `err.code` is
65
65
one of the error codes listed below.
66
66
67
67
68
- ## dns.resolve4(domain , callback)
68
+ ## dns.resolve4(hostname , callback)
69
69
70
70
The same as ` dns.resolve() ` , but only for IPv4 queries (` A ` records).
71
71
` addresses ` is an array of IPv4 addresses (e.g.
72
72
` ['74.125.79.104', '74.125.79.105', '74.125.79.106'] ` ).
73
73
74
- ## dns.resolve6(domain , callback)
74
+ ## dns.resolve6(hostname , callback)
75
75
76
76
The same as ` dns.resolve4() ` except for IPv6 queries (an ` AAAA ` query).
77
77
78
78
79
- ## dns.resolveMx(domain , callback)
79
+ ## dns.resolveMx(hostname , callback)
80
80
81
81
The same as ` dns.resolve() ` , but only for mail exchange queries (` MX ` records).
82
82
83
83
` addresses ` is an array of MX records, each with a priority and an exchange
84
84
attribute (e.g. ` [{'priority': 10, 'exchange': 'mx.example.com'},...] ` ).
85
85
86
- ## dns.resolveTxt(domain , callback)
86
+ ## dns.resolveTxt(hostname , callback)
87
87
88
88
The same as ` dns.resolve() ` , but only for text queries (` TXT ` records).
89
- ` addresses ` is an array of the text records available for ` domain ` (e.g.,
89
+ ` addresses ` is an array of the text records available for ` hostname ` (e.g.,
90
90
` ['v=spf1 ip4:0.0.0.0 ~all'] ` ).
91
91
92
- ## dns.resolveSrv(domain , callback)
92
+ ## dns.resolveSrv(hostname , callback)
93
93
94
94
The same as ` dns.resolve() ` , but only for service records (` SRV ` records).
95
- ` addresses ` is an array of the SRV records available for ` domain ` . Properties
95
+ ` addresses ` is an array of the SRV records available for ` hostname ` . Properties
96
96
of SRV records are priority, weight, port, and name (e.g.,
97
97
` [{'priority': 10, {'weight': 5, 'port': 21223, 'name': 'service.example.com'}, ...] ` ).
98
98
99
- ## dns.resolveNs(domain , callback)
99
+ ## dns.resolveNs(hostname , callback)
100
100
101
101
The same as ` dns.resolve() ` , but only for name server records (` NS ` records).
102
- ` addresses ` is an array of the name server records available for ` domain `
102
+ ` addresses ` is an array of the name server records available for ` hostname `
103
103
(e.g., ` ['ns1.example.com', 'ns2.example.com'] ` ).
104
104
105
- ## dns.resolveCname(domain , callback)
105
+ ## dns.resolveCname(hostname , callback)
106
106
107
107
The same as ` dns.resolve() ` , but only for canonical name records (` CNAME `
108
108
records). ` addresses ` is an array of the canonical name records available for
109
- ` domain ` (e.g., ` ['bar.example.com'] ` ).
109
+ ` hostname ` (e.g., ` ['bar.example.com'] ` ).
110
110
111
111
## dns.reverse(ip, callback)
112
112
113
- Reverse resolves an ip address to an array of domain names .
113
+ Reverse resolves an ip address to an array of hostnames .
114
114
115
- The callback has arguments ` (err, domains ) ` .
115
+ The callback has arguments ` (err, hostnames ) ` .
116
116
117
117
On error, ` err ` is an ` Error ` object, where ` err.code ` is
118
118
one of the error codes listed below.
@@ -143,7 +143,7 @@ Each DNS query can return one of the following error codes:
143
143
- ` dns.NOTIMP ` : DNS server does not implement requested operation.
144
144
- ` dns.REFUSED ` : DNS server refused query.
145
145
- ` dns.BADQUERY ` : Misformatted DNS query.
146
- - ` dns.BADNAME ` : Misformatted domain name .
146
+ - ` dns.BADNAME ` : Misformatted hostname .
147
147
- ` dns.BADFAMILY ` : Unsupported address family.
148
148
- ` dns.BADRESP ` : Misformatted DNS reply.
149
149
- ` dns.CONNREFUSED ` : Could not contact DNS servers.
@@ -160,4 +160,3 @@ Each DNS query can return one of the following error codes:
160
160
- ` dns.LOADIPHLPAPI ` : Error loading iphlpapi.dll.
161
161
- ` dns.ADDRGETNETWORKPARAMS ` : Could not find GetNetworkParams function.
162
162
- ` dns.CANCELLED ` : DNS query cancelled.
163
-
0 commit comments