From abfd378fe9500a97e5fdc28450735440a2ce46ff Mon Sep 17 00:00:00 2001 From: Gabi Date: Fri, 2 Aug 2024 03:59:24 -0300 Subject: [PATCH] fix(connlib): Disable hickory cache (#6143) This seems to fix #6033 What **seems** to be happening is that sometimes responses are delayed and hickory cache the negative response. We disable the cache, and the multiple attempts to be as transparent as possible until #6141 is implemented. Furthermore, the lack of recursion available in responses can cause issues in some clients and enabling it shouldn't cause any problems. --- rust/connlib/tunnel/src/dns.rs | 1 + rust/connlib/tunnel/src/io.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/rust/connlib/tunnel/src/dns.rs b/rust/connlib/tunnel/src/dns.rs index 81a99f096..23fed5e1a 100644 --- a/rust/connlib/tunnel/src/dns.rs +++ b/rust/connlib/tunnel/src/dns.rs @@ -305,6 +305,7 @@ pub(crate) fn build_response_from_resolve_result( let mut message = original_pkt.unwrap_as_dns(); message.set_message_type(MessageType::Response); + message.set_recursion_available(true); let response = match response.map_err(|err| err.kind().clone()) { Ok(response) => message.add_answers(response.records().to_vec()), diff --git a/rust/connlib/tunnel/src/io.rs b/rust/connlib/tunnel/src/io.rs index 68e3f8c48..ec14f7892 100644 --- a/rust/connlib/tunnel/src/io.rs +++ b/rust/connlib/tunnel/src/io.rs @@ -273,6 +273,8 @@ fn create_resolvers( let mut resolver_opts = ResolverOpts::default(); resolver_opts.edns0 = true; + resolver_opts.cache_size = 0; + resolver_opts.attempts = 1; ( sentinel,