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

Add support for TCP fallback when we receive a truncated DnsResponse #9139

Merged
merged 2 commits into from May 17, 2019

Conversation

Projects
None yet
2 participants
@normanmaurer
Copy link
Member

commented May 9, 2019

Motivation:

Sometimes DNS responses can be very large which mean they will not fit in a UDP packet. When this is happening the DNS server will set the TC flag (truncated flag) to tell the resolver that the response was truncated. When a truncated response was received we should allow to retry via TCP and use the received response (if possible) as a replacement for the truncated one.

See https://tools.ietf.org/html/rfc7766.

Modifications:

  • Add support for TCP fallback by allow to specify a socketChannelFactory / socketChannelType on the DnsNameResolverBuilder. If this is set to something different then null we will try to fallback to TCP.
  • Add decoder / encoder for TCP
  • Add unit tests

Result:

Support for TCP fallback as defined by https://tools.ietf.org/html/rfc7766 when using DnsNameResolver.

@normanmaurer normanmaurer force-pushed the dns_tcp_fallback branch from eff2348 to 4fb386b May 9, 2019

@normanmaurer

This comment has been minimized.

Copy link
Member Author

commented May 9, 2019

This fixes #9127

@normanmaurer normanmaurer requested review from ejona86 and trustin May 9, 2019

@normanmaurer normanmaurer force-pushed the dns_tcp_fallback branch from 4fb386b to f896eb0 May 9, 2019

Add support for TCP fallback when we receive a truncated DnsResponse
Motivation:

Sometimes DNS responses can be very large which mean they will not fit in a UDP packet. When this is happening the DNS server will set the TC flag (truncated flag) to tell the resolver that the response was truncated. When a truncated response was received we should allow to retry via TCP and use the received response (if possible) as a replacement for the truncated one.

See https://tools.ietf.org/html/rfc7766.

Modifications:

- Add support for TCP fallback by allow to specify a socketChannelFactory / socketChannelType on the DnsNameResolverBuilder. If this is set to something different then null we will try to fallback to TCP.
- Add decoder / encoder for TCP
- Add unit tests

Result:

Support for TCP fallback as defined by https://tools.ietf.org/html/rfc7766 when using DnsNameResolver.

@normanmaurer normanmaurer force-pushed the dns_tcp_fallback branch from f896eb0 to 0448ec1 May 9, 2019

@normanmaurer normanmaurer added this to the 4.1.37.Final milestone May 9, 2019

@normanmaurer

This comment has been minimized.

Copy link
Member Author

commented May 14, 2019

@trustin @ejona86 any comments ?

@normanmaurer normanmaurer requested a review from njhill May 14, 2019

@normanmaurer normanmaurer merged commit 1672b6d into 4.1 May 17, 2019

3 checks passed

pull request validation (centos6-java11) Build finished.
Details
pull request validation (centos6-java12) Build finished.
Details
pull request validation (centos6-java8) Build finished.
Details

@normanmaurer normanmaurer deleted the dns_tcp_fallback branch May 17, 2019

normanmaurer added a commit that referenced this pull request May 17, 2019

Add support for TCP fallback when we receive a truncated DnsResponse (#…
…9139)

Motivation:

Sometimes DNS responses can be very large which mean they will not fit in a UDP packet. When this is happening the DNS server will set the TC flag (truncated flag) to tell the resolver that the response was truncated. When a truncated response was received we should allow to retry via TCP and use the received response (if possible) as a replacement for the truncated one.

See https://tools.ietf.org/html/rfc7766.

Modifications:

- Add support for TCP fallback by allow to specify a socketChannelFactory / socketChannelType on the DnsNameResolverBuilder. If this is set to something different then null we will try to fallback to TCP.
- Add decoder / encoder for TCP
- Add unit tests

Result:

Support for TCP fallback as defined by https://tools.ietf.org/html/rfc7766 when using DnsNameResolver.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.