From 2afb8adc7d87233783b4fa5009a7b1c99ff1617b Mon Sep 17 00:00:00 2001 From: Razvan Dimescu Date: Fri, 10 Apr 2026 19:49:14 +0300 Subject: [PATCH] fix: scope mobileconfig DNS to Wi-Fi only via OnDemandRules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without OnDemandRules, iOS applies the DoT profile globally — cellular DNS breaks when the phone leaves the LAN. Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitignore | 1 + src/mobileconfig.rs | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 1c510fd..649d86b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ CLAUDE.md docs/ site/blog/posts/ +ios/ diff --git a/src/mobileconfig.rs b/src/mobileconfig.rs index 513d198..4ef1740 100644 --- a/src/mobileconfig.rs +++ b/src/mobileconfig.rs @@ -144,8 +144,6 @@ fn build_ca_payload(ca_pem: &str) -> String { } /// Render the `com.apple.dnsSettings.managed` payload dict for Full mode. -/// Pins the device to Numa as its system resolver over DoT with -/// `ServerName = "numa.numa"` (must match the DoT cert SAN). fn build_dns_payload(lan_ip: Ipv4Addr) -> String { format!( r#" @@ -160,8 +158,21 @@ fn build_dns_payload(lan_ip: Ipv4Addr) -> String { ServerName numa.numa + OnDemandRules + + + Action + Connect + InterfaceTypeMatch + WiFi + + + Action + Disconnect + + PayloadDescription - Routes all DNS queries through Numa over DNS-over-TLS + Routes DNS queries through Numa over DoT when on Wi-Fi PayloadDisplayName Numa DNS-over-TLS PayloadIdentifier