title: Cloud Functions for Firebase - getaddrinfo ENOTFOUND
body: <p>Trying to make a request to Paypal's API using <a href="https://github.com/paypal/PayPal-node-SDK" rel="noreferrer">PayPal-node-SDK</a></p>
  
  <pre><code>exports.requestPayment = functions.https.onRequest((req, res) =&gt; {
      return new Promise(function (fullfilled, rejected) {
          paypal.payment.create(create_payment_json, {}, function (error, payment) {
              if (error) {
                  rejected(error);
              } else {
                  console.log("Create Payment Response");
                  console.log(payment);
                  res.status(200).send(JSON.stringify({
                      paymentID: payment.id
                  })).end();
                  fullfilled(payment);
              }
          });
       });
  });
  </code></pre>
  
  <p>but I'm constantly getting an error:</p>
  
  <pre><code>Error: getaddrinfo ENOTFOUND api.sandbox.paypal.com api.sandbox.paypal.com:443
      at errnoException (dns.js:28:10)
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
  </code></pre>
  
  <p>Things I've tried:</p>
  
  <ol>
  <li>Making a request to a totally different host, still <code>ENOTFOUND</code></li>
  <li>Wrapping the request with <code>cors(req,res, ()=&gt;{...})</code></li>
  <li>Prepending <code>https://</code> to the host</li>
  </ol>
  
  <p>What is the problem?</p>