DNSmasq搭建内网DNS服务器


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.8
nameserver 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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM