公共 DNS

114.114.114.114 越来越不像话,广告插入已经丧心病狂了,gtt 测试了如下的 DNS,目前感觉良好,推荐之。

厂商 DNS
baidu 180.76.76.76
阿里云 223.5.5.5 223.6.6.6
DNSPod 119.29.29.29 182.254.116.116

/etc/resolv.conf

nameserver 119.29.29.29
nameserver 182.254.116.116
nameserver 114.114.114.114 

# options single-request-reopen

关于single-request-reopen的解释:

The resolver uses the same socket for the A and AAAA
requests.  Some hardware mistakenly sends back only one
reply.  When that happens the client system will sit
and wait for the second reply.  Turning this option on
changes this behavior so that if two requests from the
same port are not handled correctly it will close the
socket and open a new one before sending the second
request

默认情况下 resolver 会使用同一个源端口地址向 DNS 服务器发送两个请求,分别是 A 和 AAAA 的请求。在某些情况下这种请求会被防火墙拦截导致 DNS 解析特别慢或者无法解析。此时设置 single-request-reopen 则会强制 resolver 打开一个新的 socket (即使用新的源端口)发送请求,解决这种问题。