安装 dnsmasq
yum install dnsmasq -y
添加相关配置进 /etc/dnsmasq.conf
/etc/dnsmasq.conf
resolv-file=/etc/resolv.dnsmasq.conf
strict-order
listen-address=10.0.2.130
conf-dir=/etc/dnsmasq.d
addn-hosts=/etc/dnsmasq.hosts
填写上游dns服务器ip
vim /etc/resolv.dnsmasq.conf
nameserver 10.0.0.101
填写自建的dns解析
vim /etc/dnsmasq.hosts
10.239.47.134 bdpe101
10.239.47.131 bdpe72
10.239.47.29 bdpe82
10.239.47.30 bdpe91
10.239.47.174 bdpe92
10.239.47.120 bdpe102
重启 dnsmasq
systemctl restart dnsmasq