~ubuntu-branches/ubuntu/trusty/nodejs/trusty-proposed

« back to all changes in this revision

Viewing changes to doc/api/dns.json

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2013-12-12 23:04:07 UTC
  • mfrom: (1.1.30)
  • Revision ID: package-import@ubuntu.com-20131212230407-xfa6gka4c6oatsx1
Tags: 0.10.23~dfsg1-1
* Upstream update.
* Refresh patches, remove 1005 patch, applied upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
      "name": "dns",
7
7
      "stability": 3,
8
8
      "stabilityText": "Stable",
9
 
      "desc": "<p>Use <code>require(&#39;dns&#39;)</code> to access this module. All methods in the dns module\nuse C-Ares except for <code>dns.lookup</code> which uses <code>getaddrinfo(3)</code> in a thread\npool. C-Ares is much faster than <code>getaddrinfo</code> but the system resolver is\nmore constant with how other programs operate. When a user does\n<code>net.connect(80, &#39;google.com&#39;)</code> or <code>http.get({ host: &#39;google.com&#39; })</code> the\n<code>dns.lookup</code> method is used. Users who need to do a large number of lookups\nquickly should use the methods that go through C-Ares.\n\n</p>\n<p>Here is an example which resolves <code>&#39;www.google.com&#39;</code> then reverse\nresolves the IP addresses which are returned.\n\n</p>\n<pre><code>var dns = require(&#39;dns&#39;);\n\ndns.resolve4(&#39;www.google.com&#39;, function (err, addresses) {\n  if (err) throw err;\n\n  console.log(&#39;addresses: &#39; + JSON.stringify(addresses));\n\n  addresses.forEach(function (a) {\n    dns.reverse(a, function (err, domains) {\n      if (err) {\n        throw err;\n      }\n\n      console.log(&#39;reverse for &#39; + a + &#39;: &#39; + JSON.stringify(domains));\n    });\n  });\n});</code></pre>\n",
 
9
      "desc": "<p>Use <code>require(&#39;dns&#39;)</code> to access this module. All methods in the dns module\nuse C-Ares except for <code>dns.lookup</code> which uses <code>getaddrinfo(3)</code> in a thread\npool. C-Ares is much faster than <code>getaddrinfo</code> but the system resolver is\nmore consistent with how other programs operate. When a user does\n<code>net.connect(80, &#39;google.com&#39;)</code> or <code>http.get({ host: &#39;google.com&#39; })</code> the\n<code>dns.lookup</code> method is used. Users who need to do a large number of lookups\nquickly should use the methods that go through C-Ares.\n\n</p>\n<p>Here is an example which resolves <code>&#39;www.google.com&#39;</code> then reverse\nresolves the IP addresses which are returned.\n\n</p>\n<pre><code>var dns = require(&#39;dns&#39;);\n\ndns.resolve4(&#39;www.google.com&#39;, function (err, addresses) {\n  if (err) throw err;\n\n  console.log(&#39;addresses: &#39; + JSON.stringify(addresses));\n\n  addresses.forEach(function (a) {\n    dns.reverse(a, function (err, domains) {\n      if (err) {\n        throw err;\n      }\n\n      console.log(&#39;reverse for &#39; + a + &#39;: &#39; + JSON.stringify(domains));\n    });\n  });\n});</code></pre>\n",
10
10
      "methods": [
11
11
        {
12
12
          "textRaw": "dns.lookup(domain, [family], callback)",