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