Skip to content

Conversation

landonxjames
Copy link
Contributor

@landonxjames landonxjames commented Aug 19, 2025

Motivation and Context

Add an optional in-memory HickoryDnsResolver to aws-smithy-runtime. This is mostly targeted at supporting customers on AL2023 since it has disabled OS level DNS caching by default. Hyper relies on OS DNS caching if no DNS resolver is provided and this has led to some DNS throttling for users. See links below for examples:

We leverage the hickory-resolver crate to provide this functionality.

Description

Add new HickoryDnsResolver under aws_smithy_dns. This wraps a hickory_resolver::Resolver and provides some minimal configuration options (timeouts, retries, etc.) that seem unlikely to ever go away even though the hickory-dns ecosystem is still pre-1x.

Testing

Added new integration tests at tests/hickory.rs. These tests spin up an in-process DNS server on a random port and query it over localhost.

Had to fix CrateSetTest.kt since the TOML library we use in Kotlin won't parse Cargo.toml files with cfg statements like [target.'cfg(not(target_family = "wasm"))'.dependencies]. I had to add one of those statements to prevent hickory-resolver from being compiled for WASM targets since it was introducing a tokio feature that caused compilation to fail and that caused aws-smithy-runtime to fail in the stability test.

Checklist

  • For changes to the smithy-rs codegen or runtime crates, I have created a changelog entry Markdown file in the .changelog directory, specifying "client," "server," or both in the applies_to key.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Needs clean up and integrating with tests
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@landonxjames landonxjames marked this pull request as ready for review August 21, 2025 18:11
@landonxjames landonxjames requested a review from a team as a code owner August 21, 2025 18:11
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@landonxjames landonxjames requested a review from a team as a code owner August 21, 2025 19:35
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link
Contributor

@aajtodd aajtodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, some questions/discussion on naming and how we expose this.

Add hickory-dns feature that enabled rt-tokio an adds hickory as a dep
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@landonxjames landonxjames changed the title Add CachingDnsResolver Add aws-smithy-dns crate and HickoryDnsResolver Aug 25, 2025
Copy link
Contributor

@ysaito1001 ysaito1001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. It might be useful to include somewhere (PR description, GitHub discussions, or a changelog) how a customer uses a hickory-based dns resolver end2end with an SDK. Doesn't have to be in this PR, even if we decide to include it.

@@ -0,0 +1,37 @@
[package]
name = "aws-smithy-dns"
version = "0.1.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, can start as unstable.

@landonxjames landonxjames merged commit a1b18e5 into main Aug 26, 2025
48 checks passed
@landonxjames landonxjames deleted the landonxjames/dns branch August 26, 2025 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants