mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 15:56:01 +00:00
fix: the active network's first three DNS servers stay ahead of public fallbacks
This commit is contained in:
1 parent
3a4c6a4a7a
commit
ece3fec8ba
1 file changed
+1
-2
@@ -279,8 +279,7 @@ class LinuxNetworkLinkComponent(
|
|||||||
.filter { !it.isLinkLocalAddress && !it.isLoopbackAddress && !it.isAnyLocalAddress }
|
.filter { !it.isLinkLocalAddress && !it.isLoopbackAddress && !it.isAnyLocalAddress }
|
||||||
.sortedBy { if (it is Inet4Address) 0 else 1 }
|
.sortedBy { if (it is Inet4Address) 0 else 1 }
|
||||||
.mapNotNull { it.hostAddress?.substringBefore('%') }
|
.mapNotNull { it.hostAddress?.substringBefore('%') }
|
||||||
val network = (own + localDnsServers()).distinct()
|
val servers = (own.take(3) + listOf("8.8.8.8", "1.1.1.1", "2001:4860:4860::8888") + own.drop(3) + localDnsServers()).distinct().take(6)
|
||||||
val servers = (network.take(2) + listOf("8.8.8.8", "1.1.1.1", "2001:4860:4860::8888") + network.drop(2)).distinct().take(6)
|
|
||||||
val text = buildString {
|
val text = buildString {
|
||||||
append("# Written by the app from the device's active network; edits are overwritten.\n")
|
append("# Written by the app from the device's active network; edits are overwritten.\n")
|
||||||
for (server in servers) append("nameserver $server\n")
|
for (server in servers) append("nameserver $server\n")
|
||||||
|
|||||||
Reference in new issue
Block a user