From 59b52e26d6287cb6a8467e54b6fe503ba384a44f Mon Sep 17 00:00:00 2001 From: Arne Date: Tue, 12 Nov 2024 20:32:50 +0100 Subject: [PATCH] Change default DNS server --- src/main/java/org/minidns/constants/DnsRootServer.java | 10 ++++++---- src/main/res/values/defaults.xml | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/minidns/constants/DnsRootServer.java b/src/main/java/org/minidns/constants/DnsRootServer.java index a5740c942..2ff9e14dc 100644 --- a/src/main/java/org/minidns/constants/DnsRootServer.java +++ b/src/main/java/org/minidns/constants/DnsRootServer.java @@ -14,6 +14,8 @@ import static org.webrtc.ApplicationContextProvider.getApplicationContext; import android.content.res.Resources; +import org.minidns.util.InetAddressUtil; + import java.net.Inet4Address; import java.net.Inet6Address; import java.net.InetAddress; @@ -95,18 +97,18 @@ public class DnsRootServer { } public static Inet4Address getRandomIpv4RootServer(Random random) { - if (getApplicationContext().getString(R.string.default_dns_server_ipv4).equals("176.9.93.198")) { + if (getApplicationContext().getString(R.string.default_dns_server_ipv4).equals("194.242.2.2")) { return IPV4_ROOT_SERVERS[random.nextInt(IPV4_ROOT_SERVERS.length)]; } else { - return null; + return InetAddressUtil.ipv4From(eu.siacs.conversations.Conversations.getContext().getString(R.string.default_dns_server_ipv4)); } } public static Inet6Address getRandomIpv6RootServer(Random random) { - if (getApplicationContext().getString(R.string.default_dns_server_ipv6).equals("[2a01:4f8:151:34aa::198]")) { + if (getApplicationContext().getString(R.string.default_dns_server_ipv6).equals("[2a07:e340::2]")) { return IPV6_ROOT_SERVERS[random.nextInt(IPV6_ROOT_SERVERS.length)]; } else { - return null; + return InetAddressUtil.ipv6From(eu.siacs.conversations.Conversations.getContext().getString(R.string.default_dns_server_ipv6)); } } diff --git a/src/main/res/values/defaults.xml b/src/main/res/values/defaults.xml index e9464385d..c0c6df352 100644 --- a/src/main/res/values/defaults.xml +++ b/src/main/res/values/defaults.xml @@ -59,6 +59,6 @@ true false spam - 176.9.93.198 - [2a01:4f8:151:34aa::198] + 194.242.2.2 + [2a07:e340::2]