We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用dnsmasq解决dns劫持,dns污染等问题
sudo apt-get install dnsmasq
sudo vim /etc/resolv.conf
将原有的内容全部注释,然后在第一行写上
nameserver 127.0.0.1
#local nameserver 127.0.0.1 #pbulic+ nameserver 119.29.29.29 #v2ex nameserver 178.79.131.110 #alibaba nameserver 223.5.5.5 #onedns nameserver 112.124.47.27 #dnspod dns+ nameserver 182.254.116.116 #114 nameserver 114.114.114.114 #google2 nameserver 8.8.4.4
sudo gedit /etc/dnsmasq.conf
将resolv-file=放开注释
resolv-file=/etc/resolv.dnsmasq
sudo vim /etc/dhcp3/dhclient.conf
找到下面这一项 #prepend domain-name-servers 127.0.0.1将前面的“#”删除。这么做的目的是为了在使用自动连接时,能在/etc/resolv.conf文件的第一行添加上“nameserver 127.0.0.1”,这样,dns缓存依然有效。
sudo vim /etc/default/dnsmasq
找到IGNORE_RESOLVCONF=yes,这一条要删除注释,删掉#号
sudo service dnsmasq restart
dig google.com
两次返回结果的时间不一样,第二次一般是0ms;多试几个网址,证明成功了。
ubuntu 16.04. Raspberry Pi 2 B+
The text was updated successfully, but these errors were encountered:
No branches or pull requests
使用dnsmasq解决dns劫持,dns污染等问题
安装
配置
修改/etc/resolv.conf文件
将原有的内容全部注释,然后在第一行写上
在/etc目录下新建resolv.dnsmasq文件
编辑“/etc/dnsmasq.conf”文件
将resolv-file=放开注释
编辑 /etc/dhcp/dhclient.conf
编辑 etc/default/dnsmasq
重启服务
测试结果:
测试环境
ubuntu 16.04.
Raspberry Pi 2 B+
The text was updated successfully, but these errors were encountered: