vi /etc/named.conf
options {
listen-on port 53 { 20.0.0.11;};
………………
allow-query { any;};
2.5:新增正反配置檔案 (/etc/named.rfc1912.zones)
vi /etc/named.rfc1912.zones
zone "cenjeal.com" IN {type master;file"cenjeal.com.zone";
allow-transfer { 20.0.0.12;};
also-notify { 20.0.0.12;};};
zone "0.0.20.in-addr.arpa" IN {type master;file"20.0.0.arpa";
allow-transfer { 20.0.0.12;};
also-notify { 20.0.0.12;};};
2.6:dns正向解析檔案(/var/named/cenjeal.com.zone)
vi /var/named/cenjeal.com.zone
$TTL 1D
@ IN SOA cenjeal.com. admin.cenjeal.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ); minimum
NS @
A 192.168.11.119
www IN A 192.168.11.119
ftp IN A 192.168.11.118
mail IN CNAME www
修改屬主
chown named:named /var/named/bdqn.com.zone
2.7:dns反向解析檔案(/var/named/20.0.0.arpa)
$TTL 1D
@ IN SOA cenjeal.com. admin.cenjeal.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ); minimum
NS @
A 192.168.11.119
119 IN PTR www.bdqn.com.
120 IN PTR ftp.bdqn.com.
121 IN PTR bbs.bdqn.com.
修改屬主 chown named:named /var/named/bdqn.com.zone
2.8:重啟服務
systemctl restart named
三:DNS從伺服器(20.0.0.12)配置
關閉防火牆
systemctl stop firewalld
systemctl disable firewalld
關閉核心防護
vi /etc/selinux/config
SELINUX=disabled
yum -y install bind install bind-chroot bind-utils bind-libs
vi /etc/named.conf
options {
listen-on port 53 { 20.0.0.12;};
………………
allow-query { any;};
新增正反配置檔案
vi /etc/named.rfc1912.zones
zone "cenjeal.com" IN {type slave;
masters { 20.0.0.11;};
allow-notify { 20.0.0.11;};file"slaves/cenjeal.com.zone";};
zone "0.0.20.in-addr.arpa" IN {type slave;
masters { 20.0.0.11;};
allow-notify { 20.0.0.11;};file"slaves/20.0.0.arpa";};
:wq
systemctl start named
四:客戶機(20.0.0.13)配置
vi /etc/resolv.conf
#主DNS伺服器
nameserver 20.0.0.11
#從DNS伺服器#nameserver 20.0.0.12