Skip to content

Commit 5c522dd

Browse files
Trotttargos
authored andcommitted
doc: standardize usage of hostname vs. host name
Unsurprisingly, we have "host name" and "hostname" used in our documentation. Let's follow the usage of Unix man pages, RFCs, and most professionally-edited sources, and use "host name" in prose and "hostname" to refer to the command and in code. It is possible to add a lint rule for this, but it will need to wait until we modify how code is displayed in headers. Coming soon (I hope). PR-URL: #31073 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Beth Griggs <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent bbb5707 commit 5c522dd

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

doc/api/dns.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ changes:
162162
the address is not an IPv4 or IPv6 address. `0` is a likely indicator of a
163163
bug in the name resolution service used by the operating system.
164164
165-
Resolves a hostname (e.g. `'nodejs.org'`) into the first found A (IPv4) or
165+
Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or
166166
AAAA (IPv6) record. All `option` properties are optional. If `options` is an
167167
integer, then it must be `4` or `6` – if `options` is not provided, then IPv4
168168
and IPv6 addresses are both returned if found.
@@ -173,7 +173,7 @@ properties `address` and `family`.
173173
174174
On error, `err` is an [`Error`][] object, where `err.code` is the error code.
175175
Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when
176-
the hostname does not exist but also when the lookup fails in other ways
176+
the host name does not exist but also when the lookup fails in other ways
177177
such as no available file descriptors.
178178
179179
`dns.lookup()` does not necessarily have anything to do with the DNS protocol.
@@ -230,7 +230,7 @@ added: v0.11.14
230230
* `hostname` {string} e.g. `example.com`
231231
* `service` {string} e.g. `http`
232232
233-
Resolves the given `address` and `port` into a hostname and service using
233+
Resolves the given `address` and `port` into a host name and service using
234234
the operating system's underlying `getnameinfo` implementation.
235235

236236
If `address` is not a valid IP address, a `TypeError` will be thrown.
@@ -255,13 +255,13 @@ If this method is invoked as its [`util.promisify()`][]ed version, it returns a
255255
added: v0.1.27
256256
-->
257257

258-
* `hostname` {string} Hostname to resolve.
258+
* `hostname` {string} Host name to resolve.
259259
* `rrtype` {string} Resource record type. **Default:** `'A'`.
260260
* `callback` {Function}
261261
* `err` {Error}
262262
* `records` {string[] | Object[] | Object}
263263

264-
Uses the DNS protocol to resolve a hostname (e.g. `'nodejs.org'`) into an array
264+
Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array
265265
of the resource records. The `callback` function has arguments
266266
`(err, records)`. When successful, `records` will be an array of resource
267267
records. The type and structure of individual results varies based on `rrtype`:
@@ -293,7 +293,7 @@ changes:
293293
specifically `options.ttl`.
294294
-->
295295

296-
* `hostname` {string} Hostname to resolve.
296+
* `hostname` {string} Host name to resolve.
297297
* `options` {Object}
298298
* `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record.
299299
When `true`, the callback receives an array of
@@ -318,7 +318,7 @@ changes:
318318
specifically `options.ttl`.
319319
-->
320320

321-
* `hostname` {string} Hostname to resolve.
321+
* `hostname` {string} Host name to resolve.
322322
* `options` {Object}
323323
* `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record.
324324
When `true`, the callback receives an array of
@@ -565,7 +565,7 @@ added: v0.1.16
565565
* `hostnames` {string[]}
566566

567567
Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
568-
array of hostnames.
568+
array of host names.
569569

570570
On error, `err` is an [`Error`][] object, where `err.code` is
571571
one of the [DNS error codes][].
@@ -700,7 +700,7 @@ added: v10.6.0
700700
expected to change in the not too distant future.
701701
New code should use `{ verbatim: true }`.
702702

703-
Resolves a hostname (e.g. `'nodejs.org'`) into the first found A (IPv4) or
703+
Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or
704704
AAAA (IPv6) record. All `option` properties are optional. If `options` is an
705705
integer, then it must be `4` or `6` – if `options` is not provided, then IPv4
706706
and IPv6 addresses are both returned if found.
@@ -711,7 +711,7 @@ being an array of objects with the properties `address` and `family`.
711711
On error, the `Promise` is rejected with an [`Error`][] object, where `err.code`
712712
is the error code.
713713
Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when
714-
the hostname does not exist but also when the lookup fails in other ways
714+
the host name does not exist but also when the lookup fails in other ways
715715
such as no available file descriptors.
716716

717717
[`dnsPromises.lookup()`][] does not necessarily have anything to do with the DNS
@@ -752,7 +752,7 @@ added: v10.6.0
752752
* `address` {string}
753753
* `port` {number}
754754

755-
Resolves the given `address` and `port` into a hostname and service using
755+
Resolves the given `address` and `port` into a host name and service using
756756
the operating system's underlying `getnameinfo` implementation.
757757

758758
If `address` is not a valid IP address, a `TypeError` will be thrown.
@@ -775,10 +775,10 @@ dnsPromises.lookupService('127.0.0.1', 22).then((result) => {
775775
added: v10.6.0
776776
-->
777777

778-
* `hostname` {string} Hostname to resolve.
778+
* `hostname` {string} Host name to resolve.
779779
* `rrtype` {string} Resource record type. **Default:** `'A'`.
780780

781-
Uses the DNS protocol to resolve a hostname (e.g. `'nodejs.org'`) into an array
781+
Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array
782782
of the resource records. When successful, the `Promise` is resolved with an
783783
array of resource records. The type and structure of individual results vary
784784
based on `rrtype`:
@@ -805,7 +805,7 @@ is one of the [DNS error codes](#dns_error_codes).
805805
added: v10.6.0
806806
-->
807807

808-
* `hostname` {string} Hostname to resolve.
808+
* `hostname` {string} Host name to resolve.
809809
* `options` {Object}
810810
* `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record.
811811
When `true`, the `Promise` is resolved with an array of
@@ -821,7 +821,7 @@ addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
821821
added: v10.6.0
822822
-->
823823

824-
* `hostname` {string} Hostname to resolve.
824+
* `hostname` {string} Host name to resolve.
825825
* `options` {Object}
826826
* `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record.
827827
When `true`, the `Promise` is resolved with an array of
@@ -1033,7 +1033,7 @@ added: v10.6.0
10331033
* `ip` {string}
10341034

10351035
Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
1036-
array of hostnames.
1036+
array of host names.
10371037

10381038
On error, the `Promise` is rejected with an [`Error`][] object, where `err.code`
10391039
is one of the [DNS error codes](#dns_error_codes).
@@ -1081,7 +1081,7 @@ Each DNS query can return one of the following error codes:
10811081
* `dns.NOTIMP`: DNS server does not implement requested operation.
10821082
* `dns.REFUSED`: DNS server refused query.
10831083
* `dns.BADQUERY`: Misformatted DNS query.
1084-
* `dns.BADNAME`: Misformatted hostname.
1084+
* `dns.BADNAME`: Misformatted host name.
10851085
* `dns.BADFAMILY`: Unsupported address family.
10861086
* `dns.BADRESP`: Misformatted DNS reply.
10871087
* `dns.CONNREFUSED`: Could not contact DNS servers.
@@ -1092,7 +1092,7 @@ Each DNS query can return one of the following error codes:
10921092
* `dns.DESTRUCTION`: Channel is being destroyed.
10931093
* `dns.BADSTR`: Misformatted string.
10941094
* `dns.BADFLAGS`: Illegal flags specified.
1095-
* `dns.NONAME`: Given hostname is not numeric.
1095+
* `dns.NONAME`: Given host name is not numeric.
10961096
* `dns.BADHINTS`: Illegal hints flags specified.
10971097
* `dns.NOTINITIALIZED`: c-ares library initialization not yet performed.
10981098
* `dns.LOADIPHLPAPI`: Error loading `iphlpapi.dll`.
@@ -1124,7 +1124,7 @@ implications for some applications, see the [`UV_THREADPOOL_SIZE`][]
11241124
documentation for more information.
11251125

11261126
Various networking APIs will call `dns.lookup()` internally to resolve
1127-
host names. If that is an issue, consider resolving the hostname to an address
1127+
host names. If that is an issue, consider resolving the host name to an address
11281128
using `dns.resolve()` and using the address instead of a host name. Also, some
11291129
networking APIs (such as [`socket.connect()`][] and [`dgram.createSocket()`][])
11301130
allow the default resolver, `dns.lookup()`, to be replaced.

0 commit comments

Comments
 (0)