Skip to content

Commit c26258e

Browse files
vsemozhetbytMylesBorins
authored andcommitted
doc: fix confusing example in dns.md
Currently, the example throws 'Error: getHostByAddr ENOTFOUND' The previous example is edited for consistency. PR-URL: #11022 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent b14d7b3 commit c26258e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

doc/api/dns.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ This category contains only one function: [`dns.lookup()`][]. **Developers
1010
looking to perform name resolution in the same way that other applications on
1111
the same operating system behave should use [`dns.lookup()`][].**
1212

13-
For example, looking up `nodejs.org`.
13+
For example, looking up `iana.org`.
1414

1515
```js
1616
const dns = require('dns');
1717

18-
dns.lookup('nodejs.org', (err, address, family) => {
19-
console.log('address: %j family: IPv%s', address, family);
18+
dns.lookup('nodejs.org', (err, addresses, family) => {
19+
console.log('addresses:', addresses);
2020
});
2121
// address: "192.0.43.8" family: IPv4
2222
```
@@ -29,13 +29,13 @@ functions do not use the same set of configuration files used by
2929
developers who do not want to use the underlying operating system's facilities
3030
for name resolution, and instead want to _always_ perform DNS queries.
3131

32-
Below is an example that resolves `'nodejs.org'` then reverse resolves the IP
32+
Below is an example that resolves `'archive.org'` then reverse resolves the IP
3333
addresses that are returned.
3434

3535
```js
3636
const dns = require('dns');
3737

38-
dns.resolve4('nodejs.org', (err, addresses) => {
38+
dns.resolve4('archive.org', (err, addresses) => {
3939
if (err) throw err;
4040

4141
console.log(`addresses: ${JSON.stringify(addresses)}`);

0 commit comments

Comments
 (0)