下載dnsmasq
http://www.thekelleys.org.uk/dnsmasq/
解壓dnsmasq
進入dnsmasq目錄
閱讀setup.html,參照安裝方法:
拷貝dnsmasq目錄下的dnsmasq.conf.example到/etc下並改名dnsmasq.conf
編輯dnsmasq的配置文件
命令: sudo gedit /etc/dnsmasq.conf
找到下面這一項
#resolv-file=
用下面的一條語句替換
resolv-file=/etc/resolv.dnsmasq.conf
確保你沒有更改過/etc/resolv.conf文件,如果改過,恢復原狀
然後執行命令
sudo cp /etc/resolv.conf /etc/resolv.dnsmasq.conf
然後編輯resolv.conf
命令;sudo gedit /etc/resolv.conf
將其中的域名服務器全部去掉,加入以下這行
nameserver 127.0.0.1
保存,退出,重啓系統