title: grpc client dns resolution failed when trying to access grpc server on same network
body: <p>I'm trying to call a GRPC server running on a .Net Core project from a Python client.</p>
  
  <p>When running against <code>localhost:5001</code> it works fine, but running against the actual IP of the machine from within the same network like <code>192.168.1.230:5001</code> it doesn't work and I get an error <code>DNS resolution failed</code>.</p>
  
  <p>I've downloaded the SSL cert and am at the moment reading it as a file from the client. It works when running against <code>localhost</code> so I don't think that is the problem.</p>
  
  <p>Is there a better way to do this kind of testing of having clients run on separate devices but on the same network as the server? Hosting the GRPC server outside during development doesn't really seem like the best solution.</p>
  
  <p>Python code:</p>
  
  <pre><code>import grpc
  import datamessage_pb2 as datamessage
  import datamessage_pb2_grpc as datamessageService
  
  
  def main():
      print("Calling grpc server")
      with open("localhost.cer", "rb") as file:
          cert = file.read()
      credentials = grpc.ssl_channel_credentials(cert)
      channel = grpc.secure_channel("https://192.168.1.230:5001", credentials)
      # channel = grpc.secure_channel("localhost:5001", credentials)
      stub = datamessageService.StationDataHandlerStub(channel)
      request = datamessage.StationDataModel(
          temperature=22.3, humidity=13.3, soilMoisture=35.0)
  
      result = stub.RegisterNewStationData(request)
      print(result)
  
  
  main()
  </code></pre>
  
  <p>Server settings in <code>Program.cs</code>:</p>
  
  <pre><code>public static IHostBuilder CreateHostBuilder(string[] args) =&gt;
              Host.CreateDefaultBuilder(args)
                  .ConfigureWebHostDefaults(webBuilder =&gt;
                  {
                      webBuilder.UseUrls("https://*:5001");
                      webBuilder.UseStartup&lt;Startup&gt;();
                  });
  </code></pre>
  
  <p>Settings in firewall:
  <a href="https://i.stack.imgur.com/5T5WV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5T5WV.png" alt="enter image description here"></a></p>
  
  <p>Traceback:</p>
  
  <pre><code>grpc._channel._Rendezvous: &lt;_Rendezvous of RPC that terminated with:
          status = StatusCode.UNAVAILABLE
          details = "DNS resolution failed"
          debug_error_string = "{"created":"@1576101634.549000000","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3934,"referenced_errors":[{"created":"@1576101634.549000000","description":"Resolver transient failure","file":"src/core/ext/filters/client_channel/resolving_lb_policy.cc","file_line":262,"referenced_errors":[{"created":"@1576101634.549000000","description":"DNS resolution failed","file":"src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc","file_line":202,"grpc_status":14,"referenced_errors":[{"created":"@1576101634.549000000","description":"OS Error","file":"src/core/lib/iomgr/resolve_address_windows.cc","file_line":96,"os_error":"No such host is known.\r\n","syscall":"getaddrinfo","wsa_error":11001}]}]}]}"
  </code></pre>