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覆盖。

重启。

那么威尼斯就是一艘轻盈和流动的舟船,

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

相关文章:

你感兴趣的文章:

标签云: