DNS服務器
主DNS服務器
unbound設置
1、安裝unbound
yum install unbound -y
2、編輯主配置文件/etc/unbound/unbound.conf
偵聽端口
interface:0.0.0.0
檢查語法錯誤:unbound-checkconf
允許所有主機向本機查詢DNS
allow-control:0.0.0.0/0 allow
創建解析文件
rhel7中正反向解析文件合並為一個,無模板文件。主配置文件中查看語法和路徑
配置文件:/etc/unbound/local.d/zyxy.conf
local-zone:"zyxy.com."static
local-data:"zyxy.com. 86400 IN SOA nx.zyxy.com. root 1 1D 1H 1W 1 H"
local-data:"ns.zyxy.com. IN A 192.168.2.254"
local-data:"serverx.zyxy.com. IN A 192.168.2.254"
local-data-ptr:"192.168.2.254 ns.zyxy.com."
local-data-ptr:"192.168.2.254 serverx.zyxy.com."
禁用unbound服務,安全隱患,更改為全部禁用
username:”unbound“改為
username:”“
防火牆放行流量
firewall-cmd --permanent --add-service=dns
firewall-cmd --reload
重啟服務
systemctl restart unbound
緩存名稱服務器
1、安裝unbound
yum -y install unbound
2、啟用unbound
systemctl enable unbound
systemctl start unbound
3、配置偵聽接口
interface:0.0.0.0
4、配置客戶端訪問權限
access-contro:192.168.2.0/24
5、配置轉發
forward-zone:
name:"."
foreward-addr:192.168.2.254
6、未簽名區域繞過DNSSEC驗證
domain-insecure:zyxy.com
7、安裝特定簽名區域的信任定位符
dig +dnssec DNSKEY zyxy.com
8、保存並檢查
unbound-checkconf
9、重啟服務
systemctl restart unbound.service
10、放行dns流量
firewall-cmd --permanent --add-service=53