如果你喜欢用游管来测试VPS的速度,那你也许就掉坑了,因为不同的googlevideo节点速度都会有差别。有的VPS因为是广播IP所以甚至会连接上遥远距离的节点,所以自选节点看googlevideo,是折腾主义者需要做的事情。

可以看到,默认的解析视频节点并不一定合理,所以可以推测部分VPS肯定也有这个问题。
为什么要泛解析?hosts不香吗? 因为…….

所以我们泛解析搭建起来吧!
CentOS7系统为例:
1 |
yum install dnsmasq -y |
编辑/etc/dnsmasq.conf 添加如下
1 2 3 4 5 6 7 8 9 |
# 严格按照 resolv-file 文件中的顺序从上到下进行 DNS 解析, 直到第一个成功解析成功为止 strict-order # 监听的 IP 地址 listen-address=127.0.0.1 # 设置缓存大小 cache-size=10240 # 泛域名解析64.233.189.105为自选IP节点 address=/googlevideo.com/64.233.189.105 address=/you马赛克tube.com/64.233.189.105 |
修改系统DNS配置,编辑/etc/resolv.conf
1 2 |
nameserver 127.0.0.1 # 一定要放在第一个 nameserver 8.8.8.8 |
启动服务
1 |
systemctl enable --now dnsmasq |
常用命令
1 2 |
查看运行状态:systemctl status dnsmasq 重启:systemctl restart dnsmasq |
测试
1 2 3 |
[root@ ~]# ping googlevideo.com PING googlevideo.com (64.233.189.105) 56(84) bytes of data. 64 bytes from www.google.com (64.233.189.105): icmp_seq=1 ttl=110 time=27.0 ms |
域名解析默认优先读取 /etc/hosts 文件,接着是/etc/dnsmasq.conf文件。所以我们也修改/etc/hosts,因为不能 泛解析google.com,我们通过hosts自定义它。
1 2 3 4 5 |
#hosts 64.233.189.105 www.google.com 64.233.189.105 google.com 64.233.189.105 translate.google.com 64.233.189.105 mail.google.com |
利用 Dnsmasq 缓存特性实现 DNS 加速
1 |
yum install bind-utils -y |
Dnsmasq 还有一项非常有用的功能就是可以对已经解析过的域名进行缓存,下次在访问这个域名的时候就可以直接返回 IP 地址。
OJBK!折腾好了吧,试试效果吧。
至于优质节点IP如何找,类似于找CF节点。
原创文章,作者:discovery,如若转载,请注明出处:https://www.pingzz.com/jiaocheng/wangzhan/348.html