一.配置系統
centos7.6
關閉selinux firewalld
網卡設置裏dns先不用配置
在resolv.conf裏配置nameserver 127.0.0.1
二.安裝dnsmasq
yum install -y dnsmasq
三.簡單配置dnsmasq
配置/etc/dnsmasq.conf
#dnsmasq config, for a complete example, see:
http://oss.segetech.com/intra/srv/dnsmasq.conf
#log all dns queries
#log-queries
#dont use hosts nameservers
no-resolv
#use google as default nameservers
server=192.168.29.1
server=8.8.4.4
server=8.8.8.8
#serve all .company queries using a specific nameserver
#explicitly define host-ip mappings
address=/www.westos.com/192.168.1.23
下面可以寫需要自己解析的域名和地址
配置完成後就可以使用了
四.web-ui管理界面webproc搭建
下載webproc管理界面
https://github.com/jpillora/webproc
使用二進制安裝
curl https://i.jpillora.com/webproc | bash
安裝完成後啓動
webproc --config /etc/dnsmasq.conf -- dnsmasq --no-daemon
後面的--no-daemon可以寫成以守護進程啓動--daemon
啓動完成後可以在瀏覽器輸入地址加端口號8080訪問,沒有賬號密碼