centos安装dnsmasq做个简易DNS
yum install dnsmasq -y
cp /etc/dnsmasq.conf /etc/dnsmasq.conf.bak
echo "" > /etc/dnsmasq.conf
vi /etc/dnsmasq.conf
port=53
strict-order
listen-address=127.0.0.1
conf-dir=/etc/dnsmasq.d
#address=/test.com/1.2.3.4
vi /etc/dnsmasq.d/dns.conf
address=/test.com/1.2.3.4
chkconfig dnsmasq on
/etc/init.d/dnsmasq restart
启动提示"dnsdomainname: Unknown host"的话
改下主机名,指向127.0.0.1就好了。
hostname查主机名,/etc/hosts加入后OK。