From 3498a54bdfd78bb1ed6eb1e480a12b63dfe2ccd6 Mon Sep 17 00:00:00 2001 From: nya~ Date: Sun, 2 Jun 2024 12:11:40 +0700 Subject: [PATCH 1/2] Change 0ms DNS to Large variant To prevent users from getting rate limited while still receiving the benefits of OISD Big and other security filters, using the "Large" variant is highly recommended for mission-critical applications or big networks. --- .../org/koitharu/kotatsu/core/network/DoHManager.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/core/network/DoHManager.kt b/app/src/main/kotlin/org/koitharu/kotatsu/core/network/DoHManager.kt index 6e82fe9c1..45dee19d3 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/core/network/DoHManager.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/core/network/DoHManager.kt @@ -85,9 +85,13 @@ class DoHManager( ).build() DoHProvider.ZERO_MS -> DnsOverHttps.Builder().client(bootstrapClient) - .url("https://0ms.dev/dns-query".toHttpUrl()) - .resolvePublicAddresses(true) - .build() + .url("https://2ca4h4crra.cloudflare-gateway.com/dns-query".toHttpUrl()) + .resolvePrivateAddresses(true) + .bootstrapDnsHosts( + listOfNotNull( + tryGetByIp("2a06:98c1:54::384a"), + ), + ).build() } private fun tryGetByIp(ip: String): InetAddress? = try { From 188fbfbb95c0469cfaeb1034a0ab650b17387823 Mon Sep 17 00:00:00 2001 From: nya~ Date: Sun, 2 Jun 2024 12:15:07 +0700 Subject: [PATCH 2/2] 0ms DNS Large variant To prevent users from getting rate limited while still receiving the benefits of OISD Big and other security filters, using the "Large" variant is highly recommended for mission-critical applications or big networks. Recommended to always use DNS-over-HTTPS since Plain is not safe. --- .../org/koitharu/kotatsu/core/network/DoHManager.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/core/network/DoHManager.kt b/app/src/main/kotlin/org/koitharu/kotatsu/core/network/DoHManager.kt index 45dee19d3..d9605c215 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/core/network/DoHManager.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/core/network/DoHManager.kt @@ -86,12 +86,8 @@ class DoHManager( DoHProvider.ZERO_MS -> DnsOverHttps.Builder().client(bootstrapClient) .url("https://2ca4h4crra.cloudflare-gateway.com/dns-query".toHttpUrl()) - .resolvePrivateAddresses(true) - .bootstrapDnsHosts( - listOfNotNull( - tryGetByIp("2a06:98c1:54::384a"), - ), - ).build() + .resolvePublicAddresses(true) + .build() } private fun tryGetByIp(ip: String): InetAddress? = try {