-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
Netty DNS resolver ignores provided DNS server address #6573
Comments
@Scottmitch can you please check as this was introduced by your change in 54c9ecf . I think @tomasherman is correct that we should ensure we not override the name servers set by the user in this case. |
temporary workaround: Use NoopDnsServerAddressStreamProvider. There is currently an issue with the APIs.
I'm leaning toward approach 2. I think it represents what we are logically trying to achieve and limits the surface area to a single interface. Since the DNS codec is labeled as |
i think the #2 makes sense ... i think having to configure two things in order to set dns server will be confusing |
@Scottmitch yep go with [2]. |
see #6588 |
Motivation: Recently DnsServerAddressStreamProvider was introduced to allow control for each query as to which DNS server should be used for resolution to respect the local host's default DNS server configuration. However resolver-dns also accepts a stream of DNS servers to use by default, but this stream is not host name aware. This creates an ambiguity as to which method is used to determine the DNS server to user during resolution, and in which order. We can remove this ambiguity and provide a more general API by just supporting DnsServerAddressStreamProvider. Modifications: - Remove the fixed DnsServerAddresses and instead only accept a DnsServerAddressStreamProvider. - Add utility methods to help use DnsServerAddressStreamProvider for a single entry, a list of entries, and get the default for the current machine. Result: Fixes netty#6573.
Motivation: Recently DnsServerAddressStreamProvider was introduced to allow control for each query as to which DNS server should be used for resolution to respect the local host's default DNS server configuration. However resolver-dns also accepts a stream of DNS servers to use by default, but this stream is not host name aware. This creates an ambiguity as to which method is used to determine the DNS server to user during resolution, and in which order. We can remove this ambiguity and provide a more general API by just supporting DnsServerAddressStreamProvider. Modifications: - Remove the fixed DnsServerAddresses and instead only accept a DnsServerAddressStreamProvider. - Add utility methods to help use DnsServerAddressStreamProvider for a single entry, a list of entries, and get the default for the current machine. Result: Fixes netty#6573.
Motivation: Recently DnsServerAddressStreamProvider was introduced to allow control for each query as to which DNS server should be used for resolution to respect the local host's default DNS server configuration. However resolver-dns also accepts a stream of DNS servers to use by default, but this stream is not host name aware. This creates an ambiguity as to which method is used to determine the DNS server to user during resolution, and in which order. We can remove this ambiguity and provide a more general API by just supporting DnsServerAddressStreamProvider. Modifications: - Remove the fixed DnsServerAddresses and instead only accept a DnsServerAddressStreamProvider. - Add utility methods to help use DnsServerAddressStreamProvider for a single entry, a list of entries, and get the default for the current machine. Result: Fixes netty#6573.
Expected behavior
In netty 4.1.8.Final, following code works fine. However, in 4.1.9 it does not send the request to provided address and sends it to default name server stream instead.
If you run this code with netty 4.1.9 in debug mode, you can see it's sending requests to system resolvers.
I suspect the problem is the
doResolveUncached
inDnsNameResolver
where you check whether the address stream is null. I think you should check whether the nameServerAddress is null and if it is, you should default to system resolvers. if it is defined however, you should make it into a stream and use it. But maybe im missing something.Netty version
4.1.8.Final is fine, 4.1.9.Final is broken
JVM version (e.g.
java -version
)1.8
OS version (e.g.
uname -a
)mac os
The text was updated successfully, but these errors were encountered: