Add Mullvad and Control D as DoH providers (#7785)
This commit is contained in:
committed by
GitHub
parent
1f9f9662bc
commit
80b4b7bee6
@@ -17,6 +17,8 @@ const val PREF_DOH_ALIDNS = 5
|
||||
const val PREF_DOH_DNSPOD = 6
|
||||
const val PREF_DOH_360 = 7
|
||||
const val PREF_DOH_QUAD101 = 8
|
||||
const val PREF_DOH_MULLVAD = 9
|
||||
const val PREF_DOH_CONTROLD = 10
|
||||
|
||||
fun OkHttpClient.Builder.dohCloudflare() = dns(
|
||||
DnsOverHttps.Builder().client(build())
|
||||
@@ -120,3 +122,37 @@ fun OkHttpClient.Builder.dohQuad101() = dns(
|
||||
)
|
||||
.build(),
|
||||
)
|
||||
|
||||
/*
|
||||
* Mullvad DoH
|
||||
* without ad blocking option
|
||||
* Source : https://mullvad.net/en/help/dns-over-https-and-dns-over-tls/
|
||||
*/
|
||||
fun OkHttpClient.Builder.dohMullvad() = dns(
|
||||
DnsOverHttps.Builder().client(build())
|
||||
.url("https://doh.mullvad.net/dns-query".toHttpUrl())
|
||||
.bootstrapDnsHosts(
|
||||
InetAddress.getByName("194.242.2.2"),
|
||||
InetAddress.getByName("193.19.108.2"),
|
||||
InetAddress.getByName("2a07:e340::2"),
|
||||
)
|
||||
.build(),
|
||||
)
|
||||
|
||||
/*
|
||||
* Control D
|
||||
* unfiltered option
|
||||
* Source : https://controld.com/free-dns/?
|
||||
*/
|
||||
|
||||
fun OkHttpClient.Builder.dohControlD() = dns(
|
||||
DnsOverHttps.Builder().client(build())
|
||||
.url("https://freedns.controld.com/p0".toHttpUrl())
|
||||
.bootstrapDnsHosts(
|
||||
InetAddress.getByName("76.76.2.0"),
|
||||
InetAddress.getByName("76.76.10.0"),
|
||||
InetAddress.getByName("2606:1a40::"),
|
||||
InetAddress.getByName("2606:1a40:1::"),
|
||||
)
|
||||
.build(),
|
||||
)
|
||||
|
||||
@@ -47,6 +47,8 @@ class NetworkHelper(context: Context) {
|
||||
PREF_DOH_DNSPOD -> builder.dohDNSPod()
|
||||
PREF_DOH_360 -> builder.doh360()
|
||||
PREF_DOH_QUAD101 -> builder.dohQuad101()
|
||||
PREF_DOH_MULLVAD -> builder.dohMullvad()
|
||||
PREF_DOH_CONTROLD -> builder.dohControlD()
|
||||
}
|
||||
|
||||
return builder
|
||||
|
||||
Reference in New Issue
Block a user