dnsmasq 参考配置格式

首先检查服务器的两个文件,确保不干扰dnsmasq的正确解析:

/etc/hosts
/etc/resolv.conf

然后修改配置:/etc/dnsmasq.conf

#log-queries
#log-facility=/var/log/dnsmasq.log
resolv-file=/etc/dnsmasq.d/resolv
strict-order
listen-address=127.0.0.1,192.168.0.53
addn-hosts=/etc/dnsmasq.d/hosts
conf-dir=/etc/dnsmasq.d,*.conf

⚠️注意那个*号

然后是/etc/dnsmasq.d/目录下的几个文件:

MyTest.conf

address=/xxx.com/1.2.3.4

MyCname.conf

cname=img.xxx.com,imgxxx.qiniudns.com

hosts

127.0.0.1 test-host

resolv:

nameserver 223.5.5.5
posted @ 2024-03-22 17:21  M1927  阅读(49)  评论(0编辑  收藏  举报