From d1dcbbf62c98c053e1ac02c4f4e90aaf67fb59ca Mon Sep 17 00:00:00 2001 From: Sergei Razukov Date: Wed, 8 May 2024 16:58:13 +0700 Subject: [PATCH] fix(outline-client): [1980] randomize list of dns severs --- .../Sources/OutlineTunnel/OutlineTunnel.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/src/cordova/apple/OutlineAppleLib/Sources/OutlineTunnel/OutlineTunnel.swift b/client/src/cordova/apple/OutlineAppleLib/Sources/OutlineTunnel/OutlineTunnel.swift index 1cb7baf4b16..152e68d955d 100644 --- a/client/src/cordova/apple/OutlineAppleLib/Sources/OutlineTunnel/OutlineTunnel.swift +++ b/client/src/cordova/apple/OutlineAppleLib/Sources/OutlineTunnel/OutlineTunnel.swift @@ -70,6 +70,8 @@ public class OutlineTunnel: NSObject, Codable { @objc public static func getTunnelNetworkSettings(tunnelRemoteAddress: String) -> NEPacketTunnelNetworkSettings { // The remote address is not used for routing, but for display in Settings > VPN > Outline. let settings = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: tunnelRemoteAddress) + var dnsList = ["1.1.1.1", "9.9.9.9", "208.67.222.222", "208.67.220.220"] + dnsList.shuffle() // Configure VPN address and routing. let vpnAddress = selectVpnAddress(interfaceAddresses: getNetworkInterfaceAddresses()) @@ -79,8 +81,8 @@ public class OutlineTunnel: NSObject, Codable { settings.ipv4Settings = ipv4Settings // Configure with Cloudflare, Quad9, and OpenDNS resolver addresses. - settings.dnsSettings = NEDNSSettings(servers: ["1.1.1.1", "9.9.9.9", "208.67.222.222", "208.67.220.220"]) - + settings.dnsSettings = NEDNSSettings(servers: dnsList) + return settings } }