From d70d6168e2b6fdeffeab70b18c25d8ab65dfdd09 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Tue, 25 Nov 2025 02:54:32 +1100 Subject: [PATCH] fix(connlib): use correct host for OpenDNS DoH URL (#10934) Fixes a small typo in the hard-coded host of the OpenDNS DoH URL. --- rust/connlib/dns-types/lib.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rust/connlib/dns-types/lib.rs b/rust/connlib/dns-types/lib.rs index 9cc1ca89c..1b1869430 100644 --- a/rust/connlib/dns-types/lib.rs +++ b/rust/connlib/dns-types/lib.rs @@ -395,7 +395,7 @@ impl DoHUrl { pub fn host(&self) -> Cow<'static, str> { match &self.0 { InnerUrl::KnownProvider(Provider::Cloudflare) => Cow::Borrowed("cloudflare-dns.com"), - InnerUrl::KnownProvider(Provider::OpenDNS) => Cow::Borrowed("dns.opendns.com"), + InnerUrl::KnownProvider(Provider::OpenDNS) => Cow::Borrowed("doh.opendns.com"), InnerUrl::KnownProvider(Provider::Quad9) => Cow::Borrowed("dns.quad9.net"), InnerUrl::KnownProvider(Provider::Google) => Cow::Borrowed("dns.google"), InnerUrl::Other(url) => { @@ -561,7 +561,15 @@ mod tests { assert_eq!(DoHUrl::google().host(), "dns.google"); assert_eq!(DoHUrl::cloudflare().host(), "cloudflare-dns.com"); assert_eq!(DoHUrl::quad9().host(), "dns.quad9.net"); - assert_eq!(DoHUrl::opendns().host(), "dns.opendns.com"); + assert_eq!(DoHUrl::opendns().host(), "doh.opendns.com"); + } + + #[test] + fn url_and_host_are_consistent() { + assert!(DoHUrl::CLOUDFLARE_URL.contains(DoHUrl::cloudflare().host().as_ref())); + assert!(DoHUrl::GOOGLE_URL.contains(DoHUrl::google().host().as_ref())); + assert!(DoHUrl::QUAD9_URL.contains(DoHUrl::quad9().host().as_ref())); + assert!(DoHUrl::OPEN_DNS_URL.contains(DoHUrl::opendns().host().as_ref())); } #[test]