From 66ededa10b8eb8265ec5bd8715bc5074801e0682 Mon Sep 17 00:00:00 2001 From: Diva M Date: Mon, 13 May 2024 10:33:18 -0500 Subject: [PATCH 1/3] fix ipv4/ipv6 lookup strategy --- iroh-net/src/dns.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iroh-net/src/dns.rs b/iroh-net/src/dns.rs index ce31f5d443..72d3c43ae7 100644 --- a/iroh-net/src/dns.rs +++ b/iroh-net/src/dns.rs @@ -68,7 +68,7 @@ fn create_default_resolver() -> Result { } // lookup IPv4 and IPv6 in parallel - options.ip_strategy = hickory_resolver::config::LookupIpStrategy::Ipv4thenIpv6; + options.ip_strategy = hickory_resolver::config::LookupIpStrategy::Ipv4AndIpv6; let resolver = AsyncResolver::tokio(config, options); Ok(resolver) From 7b44746be8f1a890b57ee99c27c6325e4f8301a0 Mon Sep 17 00:00:00 2001 From: Diva M Date: Tue, 14 May 2024 10:14:36 -0500 Subject: [PATCH 2/3] fix comment, explicitely configure concurrent requests --- iroh-net/src/dns.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iroh-net/src/dns.rs b/iroh-net/src/dns.rs index 72d3c43ae7..b28d859284 100644 --- a/iroh-net/src/dns.rs +++ b/iroh-net/src/dns.rs @@ -67,8 +67,12 @@ fn create_default_resolver() -> Result { } } - // lookup IPv4 and IPv6 in parallel - options.ip_strategy = hickory_resolver::config::LookupIpStrategy::Ipv4AndIpv6; + // ensure multiple name servers are queried concurrently + options.num_concurrent_reqs = 3; + options.timeout = std::time::Duration::from_millis(450); + + // see [`lookup_ipv4_ipv6`] for info on why we avoid LookupIpStrategy::Ipv4AndIpv6 + options.ip_strategy = hickory_resolver::config::LookupIpStrategy::Ipv4thenIpv6; let resolver = AsyncResolver::tokio(config, options); Ok(resolver) From 0f2e77c904aa2a6ff2add8428cda036fb33a0da1 Mon Sep 17 00:00:00 2001 From: Diva M Date: Tue, 14 May 2024 13:39:50 -0500 Subject: [PATCH 3/3] fix timeout typo --- iroh-net/src/dns.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iroh-net/src/dns.rs b/iroh-net/src/dns.rs index b28d859284..c4f1ab7666 100644 --- a/iroh-net/src/dns.rs +++ b/iroh-net/src/dns.rs @@ -69,7 +69,7 @@ fn create_default_resolver() -> Result { // ensure multiple name servers are queried concurrently options.num_concurrent_reqs = 3; - options.timeout = std::time::Duration::from_millis(450); + options.timeout = std::time::Duration::from_millis(4500); // see [`lookup_ipv4_ipv6`] for info on why we avoid LookupIpStrategy::Ipv4AndIpv6 options.ip_strategy = hickory_resolver::config::LookupIpStrategy::Ipv4thenIpv6;