fix: update HickoryDnsResolver to use Ipv4AndIpv6 strategy

This commit is contained in:
monosans
2026-04-16 21:07:59 +03:00
parent 8333262abe
commit 368635db8d
+5 -4
View File
@@ -31,7 +31,7 @@ pub struct HickoryDnsResolver(Arc<hickory_resolver::TokioResolver>);
impl HickoryDnsResolver {
pub async fn new() -> crate::Result<Self> {
let resolver = tokio::task::spawn_blocking(
let mut builder = tokio::task::spawn_blocking(
hickory_resolver::TokioResolver::builder_tokio,
)
.await?
@@ -42,9 +42,10 @@ impl HickoryDnsResolver {
),
hickory_resolver::net::runtime::TokioRuntimeProvider::default(),
)
})
.build()?;
Ok(Self(Arc::new(resolver)))
});
builder.options_mut().ip_strategy =
hickory_resolver::config::LookupIpStrategy::Ipv4AndIpv6;
Ok(Self(Arc::new(builder.build()?)))
}
}