Skip to content

Commit

Permalink
Hardcode popular Android Private DNS rule to fix localhost DNS problem (
Browse files Browse the repository at this point in the history
#3433)

* hardcode popular Android Private DNS rule to fix localhost DNS problem

* V2rayConfigUtil.kt: Fix hosts type

* hardcode popular Android Private DNS: Add dns.pub
  • Loading branch information
mayampi01 authored Aug 10, 2024
1 parent 2574553 commit 9d109e7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ object V2rayConfigUtil {

private fun dns(v2rayConfig: V2rayConfig): Boolean {
try {
val hosts = mutableMapOf<String, String>()
val hosts = mutableMapOf<String, Any>()
val servers = ArrayList<Any>()

//remote Dns
Expand Down Expand Up @@ -503,6 +503,12 @@ object V2rayConfigUtil {
// hardcode googleapi rule to fix play store problems
hosts["domain:googleapis.cn"] = "googleapis.com"

// hardcode popular Android Private DNS rule to fix localhost DNS problem
hosts["dns.pub"] = arrayListOf("1.12.12.12", "120.53.53.53")
hosts["dns.alidns.com"] = arrayListOf("223.5.5.5", "223.6.6.6", "2400:3200::1", "2400:3200:baba::1")
hosts["one.one.one.one"] = arrayListOf("1.1.1.1", "1.0.0.1", "2606:4700:4700::1111", "2606:4700:4700::1001")
hosts["dns.google"] = arrayListOf("8.8.8.8", "8.8.4.4", "2001:4860:4860::8888", "2001:4860:4860::8844")

// DNS dns对象
v2rayConfig.dns = V2rayConfig.DnsBean(
servers = servers,
Expand Down

0 comments on commit 9d109e7

Please sign in to comment.