一.配置系统
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

使用二进制安装
dnsmasq搭建及web-ui管理界面webproc搭建_第1张图片

curl https://i.jpillora.com/webproc | bash

安装完成后启动
webproc --config /etc/dnsmasq.conf -- dnsmasq --no-daemon
后面的--no-daemon可以写成以守护进程启动--daemon

启动完成后可以在浏览器输入地址加端口号8080访问,没有账号密码
dnsmasq搭建及web-ui管理界面webproc搭建_第2张图片