Skip to content

Commit 58e813d

Browse files
kasnderclaude
andauthored
Improve DNS fallback: use Mullvad as secondary, only fall back when list is empty (#545)
* Improve DNS fallback: use Mullvad as secondary, only fall back when list is empty - Change secondary fallback DNS from Quad9 to Mullvad (194.242.2.2) for provider diversity while remaining privacy-respecting - Only trigger fallback DNS when the list is completely empty, not when any server was stripped by the LAN filter. If public DNS servers remain after filtering, they are sufficient. https://claude.ai/code/session_013Z8GKoQnj22Bdm3RBpSzey * Fix DNS fallback comment to match updated logic https://claude.ai/code/session_013Z8GKoQnj22Bdm3RBpSzey --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 136e2e6 commit 58e813d

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ android {
1515
// Secure DNS (DoH) configuration
1616
buildConfigField "String", "DEFAULT_DOH_ENDPOINT", "\"https://dns.quad9.net/dns-query\""
1717
buildConfigField "String", "DEFAULT_DNS_IPV4", "\"9.9.9.9\""
18-
buildConfigField "String", "DEFAULT_DNS_IPV4_2", "\"149.112.112.112\""
18+
buildConfigField "String", "DEFAULT_DNS_IPV4_2", "\"194.242.2.2\""
1919
buildConfigField "String", "DEFAULT_DNS_IPV6", "\"2620:fe::fe\""
20-
buildConfigField "String", "DEFAULT_DNS_IPV6_2", "\"2620:fe::9\""
20+
buildConfigField "String", "DEFAULT_DNS_IPV6_2", "\"2a07:e340::2\""
2121

2222
externalNativeBuild {
2323
cmake {

app/src/main/java/eu/faircode/netguard/ServiceSinkhole.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,8 +1383,8 @@ public static List<InetAddress> getDns(Context context) {
13831383
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
13841384
}
13851385

1386-
// Always set DNS servers
1387-
if (listDns.size() == 0 || listDns.size() < count)
1386+
// Fallback to default DNS servers if none remain
1387+
if (listDns.size() == 0)
13881388
try {
13891389
listDns.add(InetAddress.getByName(net.kollnig.missioncontrol.BuildConfig.DEFAULT_DNS_IPV4));
13901390
listDns.add(InetAddress.getByName(net.kollnig.missioncontrol.BuildConfig.DEFAULT_DNS_IPV4_2));

0 commit comments

Comments
 (0)