From 07dfed8f4566001bd300b9add3a65620505e52ea Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Thu, 26 Jan 2017 18:07:54 +0200 Subject: [PATCH] doc: fix confusing example in dns.md Currently, the example throws 'Error: getHostByAddr ENOTFOUND' The previous example is edited for consistency. PR-URL: https://github.com/nodejs/node/pull/11022 Reviewed-By: Gibson Fahnestock Reviewed-By: James M Snell Reviewed-By: Rich Trott --- doc/api/dns.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/api/dns.md b/doc/api/dns.md index e7cbfb268c0905..f08dfc009e9910 100644 --- a/doc/api/dns.md +++ b/doc/api/dns.md @@ -10,13 +10,13 @@ This category contains only one function: [`dns.lookup()`][]. __Developers looking to perform name resolution in the same way that other applications on the same operating system behave should use [`dns.lookup()`][].__ -For example, looking up `nodejs.org`. +For example, looking up `iana.org`. ```js const dns = require('dns'); -dns.lookup('nodejs.org', (err, address, family) => { - console.log('address: %j family: IPv%s', address, family); +dns.lookup('nodejs.org', (err, addresses, family) => { + console.log('addresses:', addresses); }); // address: "192.0.43.8" family: IPv4 ``` @@ -29,13 +29,13 @@ functions do not use the same set of configuration files used by developers who do not want to use the underlying operating system's facilities for name resolution, and instead want to _always_ perform DNS queries. -Below is an example that resolves `'nodejs.org'` then reverse resolves the IP +Below is an example that resolves `'archive.org'` then reverse resolves the IP addresses that are returned. ```js const dns = require('dns'); -dns.resolve4('nodejs.org', (err, addresses) => { +dns.resolve4('archive.org', (err, addresses) => { if (err) throw err; console.log(`addresses: ${JSON.stringify(addresses)}`);