title: Node.js getaddrinfo ENOTFOUND
body: <p>When using Node.js to try and get the html content of the following web page:</p>
  
  <p><code>eternagame.wikia.com/wiki/EteRNA_Dictionary</code></p>
  
  <p>I get the following error:</p>
  
  <pre><code>events.js:72
      throw er; // Unhandled 'error' event
            ^
  Error: getaddrinfo ENOTFOUND
      at errnoException (dns.js:37:11)
      at Object.onanswer [as oncomplete] (dns.js:124:16)
  </code></pre>
  
  <p>I did already look up this error on stackoverflow, and realized that this is because node.js cannot find the server from DNS (I think). However, I am not sure why this would be, as my code works perfectly on <code>www.google.com</code>.</p>
  
  <p>Here is my code (practically copied and pasted from a very similar question, except with the host changed):</p>
  
  <pre><code>var http = require("http");
  
  var options = {
      host: 'eternagame.wikia.com/wiki/EteRNA_Dictionary'
  };
  
  http.get(options, function (http_res) {
      // initialize the container for our data
      var data = "";
  
      // this event fires many times, each time collecting another piece of the response
      http_res.on("data", function (chunk) {
          // append this chunk to our growing `data` var
          data += chunk;
      });
  
      // this event fires *one* time, after all the `data` events/chunks have been gathered
      http_res.on("end", function () {
          // you can use res.send instead of console.log to output via express
          console.log(data);
      });
  });
  </code></pre>
  
  <p>Here is the source where I copied and pasted from : <a href="https://stackoverflow.com/questions/6695143/how-to-make-web-service-calls-in-expressjs">How to make web service calls in Expressjs?</a></p>
  
  <p>I am not using any modules with node.js.</p>
  
  <p>Thanks for reading.</p>