1.安裝dnsmasq
yum install -y dnsmasq
2.配置配置文件
vim /etc/dnsmasq.conf
no-hosts
resolv-file=/etc/resolv.dnsmasq.conf
strict-order
listen-address=192.168.0.43,127.0.0.1
addn-hosts=/etc/dnsmasq.hosts
vim /etc/resolv.conf
nameserver 127.0.0.1
vim /etc/resolv.dnsmasq.conf
nameserver 8.8.8.8nameserver 115.115.115.115
cp /etc/hosts /etc/dnsmasq.hosts 把/etc/hosts拷貝過來
3.配置需要解析的域名
vim /etc/dnsmasq.hosts 添加 ip 域名
192.168.1.7 nexus.szhmxxkj.com
4.配置客戶機DNS服務器地址
增加上內網DNS服務器ip