title: ENOTFOUND error with express.js (nodejs)
body: <p>whenever I try to do some redirecting to another web page (e.g. google.com) with my nodejs express server it will fail returning the following error:</p>
  
  <pre><code>  throw er; // Unhandled stream error in pipe.
          ^
  Error: getaddrinfo ENOTFOUND google.com
  at errnoException (dns.js:44:10)
  at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:94:26)
  </code></pre>
  
  <p>I tried many differend solutions I found on SO (e.g. <a href="https://stackoverflow.com/questions/17690803/node-js-getaddrinfo-enotfound">Node.js getaddrinfo ENOTFOUND</a>)  already. Not even the ones I found on the node.js (<a href="https://nodejs.org/api/http.html#http_http_get_options_callback" rel="nofollow noreferrer">https://nodejs.org/api/http.html#http_http_get_options_callback</a> for example) website won't work.
  Right now I am trying the most simple version:</p>
  
  <pre><code>var express = require('express');
  var app = express();
  
  var request = require('request');
  app.get('/', function(req,res) {
  
       var newurl = 'http://google.com/';
       request(newurl).pipe(res);
   });
   app.listen(1337);
  </code></pre>
  
  <p>or this one</p>
  
  <pre><code>var request = require('request');
  request('http://www.google.com', function (error, response, body) {
      if (!error &amp;&amp; response.statusCode == 200) {
          console.log(body) // Show the HTML for the Google homepage.
      } else {
          console.log(error, response, body);
      }
  });
  </code></pre>