grpc: C-Ares cannot find DNS Servers

What version of gRPC and what language are you using?

C# .Net Standard 2.0 gRPC 1.21.0

What operating system (Linux, Windows,…) and version?

Windows 10 Version 1809

What runtime / compiler are you using (e.g. python version or version of gcc)

vbcs.exe via MSBUILD

What did you do?

If possible, provide a recipe for reproducing the error. Try being specific and include code snippets if helpful.

The client is unable to resolve DNS address of the server unless the GRPC_DNS_RESOLVER environment variable to “native”.

What did you expect to see?

I expected gRPC to work out of the box, I would not need to set the GRPC_DNS_RESOLVER environment variable.

What did you see instead?

C-Ares “Could not contact DNS servers” .

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).

Below are the gRPC logs, any help is greatly appreciated!

I0814 18:33:56.089860 0 T:\src\github\grpc\workspace_csharp_ext_windows_x64\src\core\ext\filters\client_channel\resolving_lb_policy.cc:318: resolving_lb=000002315BE67890: resolver transient failure: {"created":"@1565822036.090000000","description":"DNS resolution failed","file":"T:\src\github\grpc\workspace_csharp_ext_windows_x64\src\core\ext\filters\client_channel\resolver\dns\c_ares\dns_resolver_ares.cc","file_line":358,"grpc_status":14,"referenced_errors":[{"created":"@1565822036.088000000","description":"C-ares status is not ARES_SUCCESS: Could not contact DNS servers","file":"T:\src\github\grpc\workspace_csharp_ext_windows_x64\src\core\ext\filters\client_channel\resolver\dns\c_ares\grpc_ares_wrapper.cc","file_line":244,"referenced_errors":[{"created":"@1565822036.088000000","description":"C-ares status is not ARES_SUCCESS: Could not contact DNS servers","file":"T:\src\github\grpc\workspace_csharp_ext_windows_x64\src\core\ext\filters\client_channel\resolver\dns\c_ares\grpc_ares_wrapper.cc","file_line":244}]}]}

Anything else we should know about your project / environment?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 19 (8 by maintainers)

Most upvoted comments

Note that this error occurs also when incorrectly invoking new Channel("https://host:port", ...) instead of new Channel("host:port", ...)

A coworker on my team, who doesn’t use GH, had to use GRPC_DNS_RESOLVER=native to get the .NET Firebase Admin SDK to connect to his DB instance.

Would be nice if there was a more proper fix for this.

i’m experiencing this issue as well. GRPC_DNS_RESOLVER=native does make it work.

on windows, trying to resolve an A record in an AWS private hosted zone http only.

@apolcyn did you manage to get any progress on that?

We see the same error in Python when gRPC client is pointed to the AWS network loadbalncer, and we pull on of the server instances out of the group:

Traceback (most recent call last):
  File "/Users/will/kraken_venv/lib/python3.6/site-packages/syntheseas/protobay/clients/kraken.py", line 90, in health_check
    health_check_response = self.stub.HealthCheck(health_check_request, metadata=self.metadata)
  File "/Users/will/kraken_venv/lib/python3.6/site-packages/grpc/_channel.py", line 565, in __call__
    return _end_unary_response_blocking(state, call, False, None)
  File "/Users/will/kraken_venv/lib/python3.6/site-packages/grpc/_channel.py", line 467, in _end_unary_response_blocking
    raise _Rendezvous(state, None, None, deadline)
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
	status = StatusCode.UNAVAILABLE
	details = "DNS resolution failed"
	debug_error_string = "{"created":"@1573079988.460198000","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3528,"referenced_errors":[{"created":"@1573079988.460192000","description":"Resolver transient failure","file":"src/core/ext/filters/client_channel/resolving_lb_policy.cc","file_line":307,"referenced_errors":[{"created":"@1573079988.460191000","description":"DNS resolution failed","file":"src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc","file_line":358,"grpc_status":14,"referenced_errors":[{"created":"@1573079988.460174000","description":"C-ares status is not ARES_SUCCESS: Could not contact DNS servers","file":"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc","file_line":244,"referenced_errors":[{"created":"@1573079988.460155000","description":"C-ares status is not ARES_SUCCESS: Could not contact DNS servers","file":"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc","file_line":244}]}]}]}]}"