seanmonstar / reqwest

An easy and powerful Rust HTTP Client
https://docs.rs/reqwest
Apache License 2.0
9.76k stars 1.1k forks source link

Feature flush trust_dns #1407

Open dns2utf8 opened 2 years ago

dns2utf8 commented 2 years ago

Hi there

My machine is travelling between many networks per day. I use trust_dns for enhanced security but sometimes the networks lack IPv6 or IPv4 connections. Most of my target hosts are dual-stack the problem however, if the current network does not support the connection type used on the first network of the day the connection fails because it is still trying with the same address.

Could we add a flush function or pass trough the trust_dns resolver so one can flush that cache when needed?

dns2utf8 commented 2 years ago

I have come across this type DnsResolverWithOverrides in src/connect.rs could I use that to configure the trust dns resolver?

In this issue https://github.com/bluejekyll/trust-dns/issues/1608 there was a suggestion to set the positive_max_ttl config option. Are there any docs on that yet?

LakhsmikanthD commented 1 year ago

Hey, I'm encountering a trust_dns issue while using reqwest.

Description of My Issue:

  1. Successfully connected my device to the network and made an initial HTTP request to a URL.
  2. Changed the device's network, which led to a modification in the /etc/resolve.conf file.
  3. Now, all subsequent HTTP calls are failing with an error message indicating an issue with sending the request for the URL. error sending request for url (https://atmosphere-dev.us-west-2.cpair.dev.braintree.tools:8080/graphql): operation timed out

I noticed that the code references the file "/etc/resolve.conf" loaded only once.

lazy_static! {
    static ref SYSTEM_CONF: io::Result<(ResolverConfig, ResolverOpts)> =
        system_conf::read_system_conf().map_err(io::Error::from);
}

Please assist me in identifying the problem and making the statement clearer for better comprehension.