yum -y install dnsmasq [root@testaaaaa ~]# cat /etc/dnsmasq.conf resolv-file=/etc/resolv.dnsmasq.conf no-hosts addn-hosts=/dev/shm/dnsrecord.txt cache-size=1024 conf-dir=/etc/dnsmasq.d,.rpmnew,.rpmsave,.rpmorig listen-address=172.17.125.239 [root@testaaaaa ~]# cat /dev/shm/dnsrecord.txt 10.10.10.1 www.123.com 10.10.10.2 www.456.com 10.10.10.3 www.sina.com [root@testaaaaa ~]# 然后每次增加解析重启下dnsmasq 客户端就改为dnsmasq的ip即可
转载于:https://blog.51cto.com/wsxxsl/2410654