"Could not contact DNS servers" even setting GRPC_DNS_RESOLVER=native

62 views
Skip to first unread message

belanke...@gmail.com

unread,
Aug 4, 2020, 7:25:36 AM8/4/20
to grpc.io

I have cross-compiled the code successfully for QNX ARM 7.0, and able to generate the binaries.


Very first thing I am going to do is to run the helloworld code on the target. So I built the helloworld code available in cpp folder(since I am using cpp). 


I copied only two files greeter_server and greeter_client in target machine. I am able to start server using greeter_server successfully. But when I run greeter_client in another window, I get failure message.

14: DNS resolution failed
Greeter received: RPC failed

Here is the logs after enabling GRPC_TRACE=ALL, GRPC_VERBOSITY=DEBUG.


Please help me know the issue.


We do not have DNS server, I tried using GRPC_DNS_RESOLVER=native, but did not helped. 


Do we need DNS? If its not DNS then, what is it failing?



Thank you in advance.


-Darshan  Belanke

Srini Polavarapu

unread,
Aug 5, 2020, 1:38:55 PM8/5/20
to grpc.io
DNS is the default name resolver in gRPC. gRPC C++ uses C-Ares as default library to resolve DNS unless you set GRPC_DNS_RESOLVER=native. Check that you have valid nameserver in /etc/resolv.conf.  It is strange that GRPC_DNS_RESOLVER=native did not help which should just use the system nameresolver. What was the error in that case? Does replacing localhost with 127.0.0.1 in the channel help?

belanke...@gmail.com

unread,
Aug 5, 2020, 11:45:29 PM8/5/20
to grpc.io
Thanks for reply @Srini. 

Yes I resolved this issue by replacing the 127.0.0.1 with localhost.
Reply all
Reply to author
Forward
0 new messages