linux 网速缓慢的解决办法
2021-01-9 10:45 1351次
先安装dnsmasq,用它来做DNS缓存,慢的原因大部分在域名解析上。
然后我们编辑dnsmasq的配置文件:
sudo vi /etc/dnsmasq.conf
找到这一行,修改为
resolv-file=/etc/resolv.dnsmasq.conf
确保我们的/etc/resolv.conf里的DNS信息正确,然后执行
cp /etc/resolv.conf /etc/resolv.dnsmasq.conf
然后将/etc/resolv.conf里的DNS改为127.0.0.1
nameserver 127.0.0.1
//注释下面这句
#usepeerdns
然后我们重启dnsmasq服务。
/etc/init.d/dnsmasq restart