fix: scope mobileconfig DNS to Wi-Fi only via OnDemandRules
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) <noreply@anthropic.com>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,3 +3,4 @@
|
|||||||
CLAUDE.md
|
CLAUDE.md
|
||||||
docs/
|
docs/
|
||||||
site/blog/posts/
|
site/blog/posts/
|
||||||
|
ios/
|
||||||
|
|||||||
@@ -144,8 +144,6 @@ fn build_ca_payload(ca_pem: &str) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Render the `com.apple.dnsSettings.managed` payload dict for Full mode.
|
/// 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 {
|
fn build_dns_payload(lan_ip: Ipv4Addr) -> String {
|
||||||
format!(
|
format!(
|
||||||
r#" <dict>
|
r#" <dict>
|
||||||
@@ -160,8 +158,21 @@ fn build_dns_payload(lan_ip: Ipv4Addr) -> String {
|
|||||||
<key>ServerName</key>
|
<key>ServerName</key>
|
||||||
<string>numa.numa</string>
|
<string>numa.numa</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
<key>OnDemandRules</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>Action</key>
|
||||||
|
<string>Connect</string>
|
||||||
|
<key>InterfaceTypeMatch</key>
|
||||||
|
<string>WiFi</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>Action</key>
|
||||||
|
<string>Disconnect</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
<key>PayloadDescription</key>
|
<key>PayloadDescription</key>
|
||||||
<string>Routes all DNS queries through Numa over DNS-over-TLS</string>
|
<string>Routes DNS queries through Numa over DoT when on Wi-Fi</string>
|
||||||
<key>PayloadDisplayName</key>
|
<key>PayloadDisplayName</key>
|
||||||
<string>Numa DNS-over-TLS</string>
|
<string>Numa DNS-over-TLS</string>
|
||||||
<key>PayloadIdentifier</key>
|
<key>PayloadIdentifier</key>
|
||||||
|
|||||||
Reference in New Issue
Block a user