感谢支持
我们一直在努力
RackNerd Banner 468x60 RackNerd Banner 468x60

Ubuntu使用DNS缓存加快上网速度

Ubuntu下安装dnsmasq,命令:


sudo apt-get install dnsmasq


编辑dnsmasq的配置文件,命令:


sudo gedit /etc/dnsmasq.conf


找到下面这一项:


#resolv-file=


用下面的一条语句替换:


resolv-file=/etc/resolv.dnsmasq.conf


然后执行命令,以/etc/resolv.conf的副本创建resolv.dnsmasq.conf:


sudo cp /etc/resolv.conf /etc/resolv.dnsmasq.conf


然后编辑resolv.conf,命令:


sudo gedit /etc/resolv.conf


将其中的域名服务器全部注释掉,加入以下这行


nameserver 127.0.0.1


保存,退出。执行以下命令:


sudo gedit /etc/ppp/peers/wvdial


在 usepeerdns 前面增加 # ,也就是把这条语句覆盖掉。以防resolv.conf的设置被pppoe覆盖。


重启。

赞(0)
转载请注明出处:服务器评测 » Ubuntu使用DNS缓存加快上网速度
分享到: 更多 (0)