检测网络连通性&公共DNS

服务提供者 链接 大陆体验 境外体验 http/https IP Version
Google https://www.gstatic.com/generate_204 5 10 204/204 4+6
Google https://www.google-analytics.com/generate_204 6 10 204/204 4+6
Google https://www.google.com/generate_204 0 10 204/204 4+6
Google https://connectivitycheck.gstatic.com/generate_204 4 10 204/204 4+6
Apple https://captive.apple.com/ 3 10 200/200 4+6
Apple🔥 https://www.apple.com/library/test/success.html 7 10 200/200 4+6
MicroSoft https://www.msftconnecttest.com/connecttest.txt 5 10 200/200 4+6
MicroSoft https://edge.microsoft.com/captiveportal/generate_204 5 10 204/204 4+6
Cloudflare https://cp.cloudflare.com/generate_204 4 10 204/204 4+6
Firefox https://detectportal.firefox.com/success.txt 5 10 200/200 4+6
V2ex https://www.v2ex.com/generate_204 0 10 204/301 4+6
小米 https://connect.rom.miui.com/generate_204 10 4 204/204 4+6
华为 https://connectivitycheck.platform.hicloud.com/generate_204 10 5 204/204 4+6
Vivo https://wifi.vivo.com.cn/generate_204 10 5 204/204 4+6
Android https://connectivitycheck.android.com/generate_204 5 10 204/204 4+6
Samsung https://connectivity.samsung.com.cn/generate_204 5 10 204/204 4+6
高通 https://www.qualcomm.cn/generate_204 7 10 204/204 4+6
阿里 https://g.alicdn.com/ 5 5 204/204 4+6
腾讯 https://file.myqcloud.com/ 5 5 204/204 4+6

以上大陆指中国大陆,境外指非中国大陆。

体验目前仅进行粗略测试延迟,大概率实际不符,仅作参考。

http/https一列表示使用指定协议进行请求,返回的状态码。部分场合对状态码要求较严格。

公共DNS

公共DNS(Public DNS)

公共DNS 名称 网址
1 DNSiui https://dns.iui.im/
2 DNSicoa https://dns.icoa.cn/
3 Adguard-dns https://adguard-dns.io/kb/zh-CN/general/dns-providers/

针对上游 DNS 的选择,如果选项内包含解析国外域名,那么可以把上游 DNS 全替换为国外的公共 DNS;如果你仅仅想解析国内域名,但是想加密你的 DNS 请求,那么请选择国内 DNS,使用 DoT,DoH,H3,DoQ 等方案来加密 DNS 查询。

  • DoT(DNS-over-TLS):通常书写为 tls://dns.example.org
  • DoH(DNS-over-HTTPS):通常书写为 https://dns.example.org
  • H3(DNS-over-H3):通常书写为 h3://dns.example.org
  • DoQ(DNS-over-QUIC):通常书写为 quic://dns.example.org

在理想情况下:

  • 速度表现:DoQ > H3 > DoT > DoH(首次)/ DoQ > H3 > DoH(keep-alive 保持连接) > DoT
  • 抗 QoS:DoT = DoH > H3 = DoQ
  • 隐蔽性:DoH = H3 > DoQ = DoT
    假设我的需求是解析国外的域名,没有污染,还得能解析国内的域名,尽量调度到比较合适的 CDN 节点。那么我可能会选择如下上游 DNS:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# 下面的 DNS 组合供选择,选择延迟较低的
# Google DNS
tls://8888.google
tls://dns.google
tls://dns.google.com
https://dns.google/dns-query
https://dns.google.com/dns-query
https://8888.google/dns-query
h3://dns.google/dns-query
h3://dns.google.com/dns-query
h3://8888.google/dns-query

# OpenDNS
tls://dns.opendns.com
https://doh.opendns.com/dns-query

# Quad9 DNS
tls://dns11.quad9.net
https://dns11.quad9.net/dns-query

# AdGuard DNS
tls://dns.AdGuard-dns.com
https://dns.AdGuard-dns.com/dns-query
quic://dns.AdGuard-dns.com
h3://dns.AdGuard-dns.com/dns-query

# NextDNS
tls://dns.nextdns.io
https://dns.nextdns.io/dns-query
quic://dns.nextdns.io
h3://dns.nextdns.io/dns-query

# 欧盟 DNS
https://zero.dns0.eu/
tls://zero.dns0.eu
quic://zero.dns0.eu

这些 DNS 需要测试其可达性,然后根据延迟排名,剔除延迟太高的 DNS,将剩余的用作日常使用。

需要注意的是,在中国境内,这些 DNS 通常不会提供最快的速度,因此解析可能比国内 DNS 慢一些,但它们不受 DNS 污染的影响。此外,启用 ECS 支持后,CDN 解析的准确性仍然相对比较高。你也可以寻找第三方无污染的 DNS 作为上游 DNS。

不过现实总是妥协与苟且的,需要有一定的分流规则,不然国内访问可能会命中国内网站的 HK 节点,实际体验没那么好,那么就需要我们稍作分流。

举个例子,你想让夸克走 Ali DNS:

1
[/quark.cn/]quic://dns.alidns.com

参考文章:timochan