title: DNS resolver giving wrong IP address when running Hyperledger Fabric Gateway
body: <p>I am running a JS file which acts as a listener to a set of channels on a Hyperledger Fabric network. In spite of the following error I am describing, the listener is able to listen to the channel (which puzzles me) based on evidence in the console output (an excerpt of which is provided below). As this code is going into production, I need to resolve whatever errors there are, even if the functionality is not affected.</p>
  <p>So I have a problem with the following JavaScript code excerpt:</p>
  <pre><code>let network, listener;
  for (var i = 0; i &lt; channelid.length; i++) {
    let cid = channelid[i];
    console.log(`Adding listener for channel ${cid}`);
    network = await gateway.getNetwork(cid);
    console.log(`await gateway.getNetwork`);
    listener = await network.addBlockListener(
      async (event) =&gt; {
        await ProcessingMap.set(event.blockData.header.number, event.blockData);
        console.log(
          `Added block ${event.blockData.header.number} to ProcessingMap`,
        );
      },
      {startBlock: parseInt(nextBlock, 10)},
    );
    console.log(`await network.addBlockListener`);
  }
  </code></pre>
  <p>(Full code can be found at <a href="https://pastebin.com/qqFPdVH6" rel="nofollow noreferrer">https://pastebin.com/qqFPdVH6</a>)</p>
  <p>When I run this code with <code>export GRPC_VERBOSITY=DEBUG</code> and <code>export GRPC_TRACE=all</code>, I get the following error at the line <code>network = await gateway.getNetwork(cid)</code> (the full log up to when the blocks start getting read can be found at <a href="https://pastebin.com/ZxJBx4ub" rel="nofollow noreferrer">https://pastebin.com/ZxJBx4ub</a>)</p>
  <pre><code>
  2020-10-06T07:43:24.424Z | resolving_load_balancer | dns:orderer1.isprint.com:7050 IDLE -&gt; IDLE
  2020-10-06T07:43:24.424Z | connectivity_state | dns:orderer1.isprint.com:7050 IDLE -&gt; IDLE
  2020-10-06T07:43:24.424Z | dns_resolver | Resolver constructed for target dns:orderer1.isprint.com:7050
  2020-10-06T07:43:24.425Z | dns_resolver | Resolution update requested for target dns:orderer1.isprint.com:7050
  2020-10-06T07:43:24.425Z | resolving_load_balancer | dns:orderer1.isprint.com:7050 IDLE -&gt; CONNECTING
  2020-10-06T07:43:24.425Z | connectivity_state | dns:orderer1.isprint.com:7050 IDLE -&gt; CONNECTING
  2020-10-06T07:43:24.426Z | resolving_load_balancer | dns:orderer1.isprint.com:7050 CONNECTING -&gt; CONNECTING
  2020-10-06T07:43:24.426Z | connectivity_state | dns:orderer1.isprint.com:7050 CONNECTING -&gt; CONNECTING
  2020-10-06T07:43:24.427Z | dns_resolver | Resolved addresses for target dns:orderer1.isprint.com:7050: [35.186.238.101:7050]
  2020-10-06T07:43:24.427Z | pick_first | IDLE -&gt; IDLE
  2020-10-06T07:43:24.427Z | resolving_load_balancer | dns:orderer1.isprint.com:7050 CONNECTING -&gt; IDLE
  2020-10-06T07:43:24.427Z | connectivity_state | dns:orderer1.isprint.com:7050 CONNECTING -&gt; IDLE
  2020-10-06T07:43:24.427Z | pick_first | Connect to address list 35.186.238.101:7050
  2020-10-06T07:43:24.427Z | subchannel | 35.186.238.101:7050 refcount 0 -&gt; 1
  2020-10-06T07:43:24.427Z | subchannel | 35.186.238.101:7050 refcount 1 -&gt; 2
  2020-10-06T07:43:24.427Z | pick_first | Start connecting to subchannel with address 35.186.238.101:7050
  2020-10-06T07:43:24.427Z | pick_first | IDLE -&gt; CONNECTING
  2020-10-06T07:43:24.427Z | resolving_load_balancer | dns:orderer1.isprint.com:7050 IDLE -&gt; CONNECTING
  2020-10-06T07:43:24.427Z | connectivity_state | dns:orderer1.isprint.com:7050 IDLE -&gt; CONNECTING
  2020-10-06T07:43:24.427Z | subchannel | 35.186.238.101:7050 IDLE -&gt; CONNECTING
  2020-10-06T07:43:24.427Z | pick_first | CONNECTING -&gt; CONNECTING
  2020-10-06T07:43:24.427Z | resolving_load_balancer | dns:orderer1.isprint.com:7050 CONNECTING -&gt; CONNECTING
  2020-10-06T07:43:24.427Z | connectivity_state | dns:orderer1.isprint.com:7050 CONNECTING -&gt; CONNECTING
  2020-10-06T07:43:27.428Z - error: [ServiceEndpoint]: Error: Failed to connect before the deadline on Committer- name: orderer1.isprint.com:7050, url:grpcs://orderer1.isprint.com:7050, connected:false, connectAttempted:true
  2020-10-06T07:43:27.429Z - error: [ServiceEndpoint]: waitForReady - Failed to connect to remote gRPC server orderer1.isprint.com:7050 url:grpcs://orderer1.isprint.com:7050 timeout:3000
  2020-10-06T07:43:27.429Z - error: [DiscoveryService]: _buildOrderer[isprintchannel] - Unable to connect to the discovered orderer orderer1.isprint.com:7050 due to Error: Failed to connect before the deadline on Committer- name: orderer1.isprint.com:7050, url:grpcs://orderer1.isprint.com:7050, connected:false, connectAttempted:true
  </code></pre>
  <p>I have no idea how come the DNS resolver is giving me that weird IP address 35.186.238.101, so I did <code>nslookup 35.186.238.101</code>:</p>
  <pre><code>[root@isprintdev nodejs]# nslookup 35.186.238.101
  Server:         192.168.1.8
  Address:        192.168.1.8#53
  
  Non-authoritative answer:
  101.238.186.35.in-addr.arpa     name = 101.238.186.35.bc.googleusercontent.com.
  </code></pre>
  <pre><code>Authoritative answers can be found from:
  
  [root@isprintdev nodejs]#
  </code></pre>
  <p>The connection profile can be found at <a href="https://pastebin.com/Ppe9JPXR" rel="nofollow noreferrer">https://pastebin.com/Ppe9JPXR</a>. In short, my network consists of three orderers and two peers, all on the same virtual machine.</p>
  <p><strong>So my question is</strong>: is there something that I need to change in my connection profile or JS code (or wherever necessary) to ensure that this error does not appear?</p>