title: Node.js dns.resolve not returning correct IP address
body: <p>I'm trying to use <a href="https://nodejs.org/api/dns.html#dns_dns_resolve_hostname_rrtype_callback" rel="nofollow noreferrer">Node.js DNS resolve</a> to look up an IP address of a domain that belong to me (let's call it host.mydomain.com). If the lookup for <code>host.mydomain.com</code> is done from the server that host.mydomain.com actually points to, it returns the server's local NIC IP address (<code>192.168.0.10</code>) instead of the server's external IP address.</p>
  
  <p>Doing a host lookup for <code>host.mydomain.com</code> from an external machine using the same code returns the expected external IP address. More importantly, I have a different server in another environment, call it <code>host.otherdomain.com</code>, that does correctly return its own external IP address when doing a lookup, using the same code.</p>
  
  <p>I do not have anything in my hosts file that would override this. Both domains are from the same DNS provider, and both are wildcard domains.</p>
  
  <p>My code:</p>
  
  <pre><code>var dns = require('dns');
  dns.setServers([ "8.8.8.8", "8.8.4.4" ]);
  
  domain="host.mydomain.com";
  
  dns.resolve(domain, function (error, addresses) {
      console.log("Error: ", error);  // null
      console.log("DNS servers: ", dns.getServers());  // [ '8.8.8.8', '8.8.4.4' ]
      console.log(domain + " resolves to: ", addresses);  // [ '192.168.0.10' ]
  });
  </code></pre>
  
  <p>I'm currently using Node.js 6 on all servers.</p>