A1_IP:192.168.164.145
A1# yum install dnsmasq -y
A1# echo "addn-hosts=/etc/domains" >> /etc/dnsmasq.conf
A1# echo "192.168.164.189 www.kd.com" > /etc/domains
A1# iptables -I INPUT -p udp --dport 53 -j ACCEPT
A1# systemctl start dnsmasq && systemctl enable dnsmasq
B1_IP:192.168.164.189
B1 # 看图
自动改动就可以实现