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覆盖。
重启。
相关推荐
  changecan    2020-11-19  
   lonesomer    2020-09-17  
   houdaiye    2020-09-23  
   XPZ0    2020-09-22  
   changecan    2020-09-22  
   jackadmi    2020-09-11  
   yuan00yu    2020-08-24  
   yserver    2020-08-15  
   liyansring    2020-08-15  
   liai    2020-08-09  
   山有木兮卿有意    2020-08-03  
   85206633    2020-07-28  
   suosuo    2020-07-28  
   83911930    2020-07-28  
   85590296    2020-07-22  
   liym    2020-07-20  
 