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