Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement authority overrides in the DNS resolver #2775

Closed
atollena opened this issue Jun 18, 2024 · 7 comments
Closed

Implement authority overrides in the DNS resolver #2775

atollena opened this issue Jun 18, 2024 · 7 comments

Comments

@atollena
Copy link

atollena commented Jun 18, 2024

Is your feature request related to a problem? Please describe.

We have use cases where we would like to use the DNS resolver with a DNS server that is not the system's DNS server.

Describe the solution you'd like

Implement DNS server authority parsing as described in https://github.com/grpc/grpc/blob/master/doc/naming.md:

authority indicates the DNS server to use, although this is only supported by some implementations. (In C-core, the default DNS resolver does not support this, but the c-ares based resolver supports specifying this in the form "IP:port".).

Describe alternatives you've considered

Do more customisation to the DNS configuration, not involving gRPC directly.

Additional context

We have workloads in javascript that run browser tests and use public DNS for most resolutions, and a custom DNS server for our internal service discovery system to report results to our internal systems.

@atollena
Copy link
Author

atollena commented Jun 18, 2024

We are likely willing to provide a patch for this, if that helps. Looking at https://github.com/grpc/grpc-node/blob/a4c2106e63064070f3b9e580b2d1c74b0a9503a4/packages/grpc-js/src/resolver-dns.ts it doesn't seem terribly complicated to add this feature.

@murgatroid99
Copy link
Member

I don't see how you would do that. The only way I can see to make requests to a different DNS server is with dns.setServers, but that is a global setting, as opposed to affecting a single request, so it is inappropriate to use in a library.

@gkampitakis
Copy link
Contributor

Something like this where you create a new resolver gkampitakis#1?

@murgatroid99
Copy link
Member

I see. I didn't realize that the Resolver class had its own setServers method. That should do it.

@gkampitakis
Copy link
Contributor

I am happy to send a pr for this 😄

@gkampitakis
Copy link
Contributor

I have created the pr with the above changes 👍

@atollena
Copy link
Author

Fixed in #2776.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants