You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had to remove the two DNS nameservers entries on my machine to get localhost to work. But this is not an appropriate fix because I needed root to do this and breaks other functionality that does need it.
I could have also
used passthrough://localhost:4317, but for some libraries such as OTEL exporters that use grpc it is currently not possible to pass through the scheme.
I tried net.DefaultResolver.LookupIP(ctx, 'ip', 'localhost') and it resolved with no issues quickly.
The issue seems to be that grpc DNS resolver is trying to contact the name servers even for simple /etc/hosts entries that net.DefaultResolver has no issues working with.
The text was updated successfully, but these errors were encountered:
Hi @peterchenadded, there isn't a way to selectively disable service config lookups for hosts. You will need to use the WithDisableServiceConfig() dial option or provide an IP address as the target (e.g: "127.0.0.1" instead of "localhost") to bypass service config lookups. To allow users to configure gRPC channels, libraries usually accept their own options structs which they convert to gRPC DialOptions internally. GCP client libraries are an example of this pattern.
Uh oh!
There was an error while loading. Please reload this page.
What version of gRPC are you using?
1.71.1
What version of Go are you using (
go version
)?1.24.2 Darwin/arm64
What operating system (Linux, Windows, …) and version?
Mac m1 Sequoia 15.5
What did you do?
This is a follow up of #7429 (comment)
Essentially tried running:
https://github.com/grpc/grpc-go/blob/master/examples/helloworld/greeter_client/main.go
But got:
This was with
It worked fine with
What did you expect to see?
I expected both localhost and 127.0.01 to work.
What did you see instead?
Only 127.0.0.1 worked
I had to remove the two DNS nameservers entries on my machine to get localhost to work. But this is not an appropriate fix because I needed root to do this and breaks other functionality that does need it.
I could have also
used passthrough://localhost:4317, but for some libraries such as OTEL exporters that use grpc it is currently not possible to pass through the scheme.
I tried net.DefaultResolver.LookupIP(ctx, 'ip', 'localhost') and it resolved with no issues quickly.
The issue seems to be that grpc DNS resolver is trying to contact the name servers even for simple /etc/hosts entries that net.DefaultResolver has no issues working with.
The text was updated successfully, but these errors were encountered: