Skip to content

feat: Support custom DNS resolver#728

Open
kdn36 wants to merge 1 commit into
apache:mainfrom
kdn36:feat_with_dns_resolver
Open

feat: Support custom DNS resolver#728
kdn36 wants to merge 1 commit into
apache:mainfrom
kdn36:feat_with_dns_resolver

Conversation

@kdn36
Copy link
Copy Markdown
Contributor

@kdn36 kdn36 commented May 20, 2026

Which issue does this PR close?

Mitigates but does not close #726.

Rationale for this change

This PR enables users of object_store to provide a custom DNS resolver. Use case: the custom DNS resolver may have different properties (e.g., caching), and a different footprint (e.g., substantially smaller) than the default options.

What changes are included in this PR?

Enables override of the DNS resolver as used by the reqwest::HttpClient.

Are there any user-facing changes?

Yes. This PR adds ClientOptions::with_dns_resolver(Arc<dyn reqwest::dns::Resolve>).

Copy link
Copy Markdown
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

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

I think this is probably fine, but generally we have tried to keep reqwest types out of our public API, especially in light of things like #724, and the fact we now support pluggable HTTP clients. The fact reqwest now has a resolve2 method, also doesn't really bode well for this API's stability longer-term 😅 It appears to have just been the legacy hyper API repackaged.

What do you think about defining our own resolve trait?

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.

Lightweight DNS cache with shuffle to prevent DNS flooding

2 participants