-
Notifications
You must be signed in to change notification settings - Fork 921
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
Consider a trailing dot when resolve DNS with search domains #5963
Merged
Commits on Oct 30, 2024
-
Consider a trailing dot when resolve DNS with search domains
Motivation: There was a report from LY internally where DNS resolver warns for `NXDomain`. ``` java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Empty label is not a legal name at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ... at com.linecorp.armeria.internal.client.dns.SearchDomainDnsResolver.resolve0(SearchDomainDnsResolver.java:99) at com.linecorp.armeria.internal.client.dns.SearchDomainDnsResolver.resolve(SearchDomainDnsResolver.java:88) at com.linecorp.armeria.internal.client.dns.HostsFileDnsResolver.resolve(HostsFileDnsResolver.java:130) at com.linecorp.armeria.internal.client.dns.DefaultDnsResolver.resolveOne(DefaultDnsResolver.java:89) at com.linecorp.armeria.internal.client.dns.DefaultDnsResolver.resolve(DefaultDnsResolver.java:81) at com.linecorp.armeria.client.endpoint.dns.DnsEndpointGroup.sendQueries(DnsEndpointGroup.java:155) at com.linecorp.armeria.client.endpoint.dns.DnsEndpointGroup.lambda$sendQueries$3(DnsEndpointGroup.java:173) ... Caused by: java.lang.IllegalArgumentException: Empty label is not a legal name at java.base/java.net.IDN.toASCIIInternal(IDN.java:284) at java.base/java.net.IDN.toASCII(IDN.java:123) at java.base/java.net.IDN.toASCII(IDN.java:152) at com.linecorp.armeria.internal.client.dns.DnsQuestionWithoutTrailingDot.<init>(DnsQuestionWithoutTrailingDot.java:53) at com.linecorp.armeria.internal.client.dns.DnsQuestionWithoutTrailingDot.of(DnsQuestionWithoutTrailingDot.java:48) at com.linecorp.armeria.internal.client.dns.SearchDomainDnsResolver$SearchDomainQuestionContext.newQuestion(SearchDomainDnsResolver.java:190) at com.linecorp.armeria.internal.client.dns.SearchDomainDnsResolver$SearchDomainQuestionContext.nextQuestion0(SearchDomainDnsResolver.java:177) at com.linecorp.armeria.internal.client.dns.SearchDomainDnsResolver$SearchDomainQuestionContext.nextQuestion(SearchDomainDnsResolver.java:150) at com.linecorp.armeria.internal.client.dns.SearchDomainDnsResolver.lambda$resolve0$1(SearchDomainDnsResolver.java:103) ... 19 common frames omitted ``` The NX domain has with a trailing dot and search domains starts with `.`. As a result, `example.com..search.domain` was made and rejected by `java.net.IDN` Modifications: - Remove a leading dot from the normalized search domains. - Infix a dot when a hostname does not have a trailing dot. Result: DNS resolver now correctly adds search domains for hostnames with trailing dots.
Configuration menu - View commit details
-
Copy full SHA for 0ef7842 - Browse repository at this point
Copy the full SHA 0ef7842View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1ff1833 - Browse repository at this point
Copy the full SHA 1ff1833View commit details
Commits on Oct 31, 2024
-
Configuration menu - View commit details
-
Copy full SHA for f6d3c22 - Browse repository at this point
Copy the full SHA f6d3c22View commit details
Commits on Nov 6, 2024
-
Configuration menu - View commit details
-
Copy full SHA for d01a90e - Browse repository at this point
Copy the full SHA d01a90eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 331d86c - Browse repository at this point
Copy the full SHA 331d86cView commit details -
Merge branch 'trailing-dot-searchdomain' of github.com:ikhoon/armeria…
… into trailing-dot-searchdomain
Configuration menu - View commit details
-
Copy full SHA for d300ae5 - Browse repository at this point
Copy the full SHA d300ae5View commit details -
Fix a flaky test and minor bugs
- Stop to send queries with search domains when it was resovled. - Fix a bug where the original hostname was sent as the last query when the number of dots in a hostname >= `ndots`. - Explicitly set `ResolvedAddressTypes.IPV4_ONLY` to avoid flakyness.
Configuration menu - View commit details
-
Copy full SHA for a02dad0 - Browse repository at this point
Copy the full SHA a02dad0View commit details -
Configuration menu - View commit details
-
Copy full SHA for ae89033 - Browse repository at this point
Copy the full SHA ae89033View commit details
Commits on Nov 7, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 90d886a - Browse repository at this point
Copy the full SHA 90d886aView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.