0
点赞
收藏
分享

微信扫一扫

dnsmasq

中间件小哥 2022-09-19 阅读 158

1、yum install dnsmasq -y
2.编辑修改dnsmasq配置文件
vim /etc/dnsmasq.conf
resolv-file=/etc/resolv.dnsmasq.conf #指定外网dns服务器
listen-address=192.168.1.250 #指定当前服务器的ip
conf-dir=/etc/dnsmasq.d # 指定解析记录都写到这个目录下
addn-hosts=/etc/dnsmasq.hosts #指定dns解析记录文件

3.填写外网dns服务器ip
vim /etc/resolv.dnsmasq.conf
nameserver 114.114.114.114
nameserver 8.8.8.8
nameserver 223.5.5.5

4.填写自建的dns解析记录

vim /etc/dnsmasq.hosts
192.168.100.3 a.com
192.168.100.10 b.com

5.修改当前服务器的,dns域名服务器,指定自建的dnsmasq服务器ip
vim /etc/resolv.conf
nameserver 192.168.1.250

6.重启dnsmasq,设置开机自启动
systemctl enable dnsmasq
systemctl start dnsmasq
systemctl restart dnsmasq

举报

相关推荐

0 条评论