From bfe04ed286ffc6b9cd95681599522c78cac364e3 Mon Sep 17 00:00:00 2001 From: Julien Gilli Date: Fri, 14 Nov 2014 10:58:54 -0800 Subject: [PATCH] doc: clarify dns.lookup vs dns.resolve Clarify and emphasize the differences between dns.lookup and the rest of the functions in the dns module. PR-URL: https://github.com/joyent/node/pull/8726 Reviewed-by: Chris Dickinson Cherry-picked-from: https://github.com/joyent/node/commit/5ff59453a483a43f1563504989f8e2d0ec253de1 --- doc/api/dns.markdown | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/api/dns.markdown b/doc/api/dns.markdown index d080d666186..1c443446779 100644 --- a/doc/api/dns.markdown +++ b/doc/api/dns.markdown @@ -2,10 +2,13 @@ Stability: 3 - Stable -Use `require('dns')` to access this module. All methods in the dns module -use C-Ares except for `dns.lookup` which uses `getaddrinfo(3)` in a thread -pool. C-Ares is much faster than `getaddrinfo` but the system resolver is -more consistent with how other programs operate. When a user does +Use `require('dns')` to access this module. All methods in the dns module use +C-Ares except for `dns.lookup` which uses `getaddrinfo(3)` in a thread pool. +C-Ares is much faster than `getaddrinfo(3)` but, due to the way it is +configured by node, it doesn't use the same set of system configuration files. +For instance, _C- Ares will not use the configuration from `/etc/hosts`_. As a +result, __only `dns.lookup` should be expected to behave like other programs +running on the same system regarding name resolution.__ When a user does `net.connect(80, 'google.com')` or `http.get({ host: 'google.com' })` the `dns.lookup` method is used. Users who need to do a large number of lookups quickly should use the methods that go through C-Ares.