歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu使用DNS緩存加快上網速度

Ubuntu使用DNS緩存加快上網速度

日期:2017/2/28 16:37:52   编辑:Linux教程

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

重啟。

Copyright © Linux教程網 All Rights Reserved