天天看點

内網簡易DNS系統

内網DNS系統

功能:解析内網域名和DNS-Cache

軟體:dnsmasq

一.安裝

yum  -y install dnsmasq

二.伺服器配置

1.vi /etc/resolv.conf 使本地查詢域名時使用dnsmasq伺服器

nameserver 127.0.0.1

2.vi /etc/dnsmasq.conf

resolv-file=/etc/dnsmasq.resolvconf 指定上層讀取的DNS伺服器檔案

no-hosts                            指定不讀取系統預設的/etc/hosts檔案

addn-hosts=/etc/dnsmasq_hosts    指定一個dnsmasq讀取的hosts檔案

strict-order                        嚴格按照resolv-file參數指定的檔案下的伺服器設定順序讀取

3.vi /etc/resolv.dnsmaq.conf        指定上層伺服器

nameserver 202.106.46.151

4.touch /etc/dnsmasq_hosts          建立一個dnsmasq讀取的hosts檔案

三.用戶端配置:

vi /etc/resolv.conf

nameserver 192.168.7.163

search lqhs.com

三.啟動

/etc/init.d/dnsmasq start

chkconfig --level 235 dnsmasq on