??????1、首先,在主服務(wù)器上配置DNS解析器。打開配置文件/etc/named.conf,添加以下內(nèi)容:
zone"example.com" IN {
type master;
file "example.com.zone";
allow-transfer { slave_ip_address:
};
};
zone"xx.168.192.in-addr.arpa" IN {
type master;
file "xx.168.192.zone";
allow-transfer{ slave_ip_address;
};
};
?
2、創(chuàng)建正向解析區(qū)域文件example.com.zone,并添加以下內(nèi)容:?
$TTL 86400
@ IN SOA ns1.example.com. admin.example.com. (
2022010101 ; Serial
3600 ; Refresh
1800 ; Retry
604800 ; Expire
86400 ) ; Minimum TTL
;
@ IN NS ns1.example.com.
@ IN NS ns2.example.com.
ns1 IN A master_ip_address
ns2 IN A slave_ip_address
www IN A web_server_ip_address
文章來源:http://www.zghlxwxcb.cn/news/detail-819396.html
?3、創(chuàng)建反向解析區(qū)域文件xx.168.192.zone,并添加以下內(nèi)容:
$TTL 86400
@ IN SOA ns1.example.com. admin.example.com. (
2022010101 ; Serial
3600 ; Refresh
1800 ; Retry
604800 ; Expire
86400 ) ; Minimum TTL
;
@ IN NS ns1.example.com.
@ IN NS ns2.example.com.
1 IN PTR ns1.example.com.
2 IN PTR ns2.example.com.
10 IN PTR www.example.com.
文章來源地址http://www.zghlxwxcb.cn/news/detail-819396.html
4、在從服務(wù)器上進行相同的配置,只需將type master改為type slave。
5、重啟DNS服務(wù),使配置生效。
sudo systemctl restart named
到了這里,關(guān)于【Linux】配置dns主從服務(wù)器,能夠?qū)崿F(xiàn)正常的正反向解析的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!