Skip to content

Add DNS configuration options to client builder #2765

@mccordryan

Description

@mccordryan

Hello!

I recently found myself in a situation where I needed to manually specify a DNS configuration (i.e. always use Cloudflare/Google/etc.) instead of using the system configuration.

I solved this fairly easily by implementing a new struct with the Resolve trait, and passing said struct in Client::builder::dns_resolver().

That said, I can't shake that this feels a little redundant, especially when reqwest is using hickory resolver (also used for my implementation) under the hood.

In my ideal world, I could pass a hickory_resolver::config::ResolverConfig directly to the client builder. Something like Client::builder::with_dns_config(SomeResolverConfig)

Not a massive issue by any means, but a smaller QoL change that would make things easier for my use case anyways. I'd be happy to open a PR, provided that you feel this would be an appropriate addition. I know the existing Resolve trait was added to be as generic as possible, so I understand if this is too niche.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions