1、搭建主renzituo.com服务器
①、在192.168.10.4主机上安装bind程序
yum -y install bind
iptables -F
setenforce 0
②、搭建主renzituo.com服务器
(1).配置为缓存服务器
打开/etc/named.conf配置文件做如下配置:
options {
listen-on port 53 { localhost; };
allow-query { any; };
recursion yes;
dnssec-enable no;
dnssec-validation no;
//bindkeys-file “/etc/named.iscdlv.key”;
//managed-keys-directory “/var/named/dynamic”;
};
(2)添加zone记录
打开/etc/named.rfc1912.zones,添加如下记录:
zone “renzituo.com” IN {
type master;
file “renzituo.com.zone”;
};
修改name.ca文件
将其根指向为192.168.10.2
. IN NS a.root-servers.net.
a.root-servers.net. IN A 192.168.10.2
(3)创建区域解析库文件,权限为640,属组为named;
touch /var/named/renzituo.com.zone并输入如下内容:
$TTL 86400
$ORIGIN renzituo.com.
@ IN SOA ns1.renzituo.com. admin.renzituo.com (
2016070901
2h
10m
7d
1d )
IN NS ns1.renzituo.com.
IN NS ns2.renzituo.com.
ns1 IN A 192.168.10.4
ns2 IN A 192.168.10.5
www IN A 210.110.119.8
ftp IN CNAME www
2.搭建从renzituo.com服务器
① 、在192.168.10.5主机上安装bind程序
yum -y install bind
iptables -F
setenforce 0
②、配置为缓存服务器
打开/etc/named.conf配置文件做如下配置:
options {
listen-on port 53 { localhost; };
allow-query { any; };
recursion yes;
dnssec-enable no;
dnssec-validation no;
//bindkeys-file “/etc/named.iscdlv.key”;
//managed-keys-directory “/var/named/dynamic”;
};
添加zone记录
打开/etc/named.rfc1912.zones,添加如下记录:
zone “renzituo.com” IN {
type slave;
masters { 192.168.10.4; };
file “slaves/renzituo.com.zone”;
};
修改name.ca文件
将其根指向为192.168.10.2
. IN NS a.root-servers.net.
a.root-servers.net. IN A 192.168.10.2
③、在主服务器上添加从服务器的NS记录;前面已经添加过就是:
IN NS ns2.renzituo.com.
ns2 IN A 192.168.10.5
3、搭建.com服务器
①、在192.168.10.3主机上面安装bind程序
yum -y install bind
ptables -F
setenforce 0
②、配置为缓存服务器
打开/etc/named.conf配置文件做如下配置:
options {
listen-on port 53 { localhost; };
allow-query { any; };
recursion yes;
dnssec-enable no;
dnssec-validation no;
//bindkeys-file “/etc/named.iscdlv.key”;
//managed-keys-directory “/var/named/dynamic”;
};
③、修改name.ca文件
将其根指向为192.168.10.2
. IN NS a.root-servers.net.
a.root-servers.net. IN A 192.168.10.2
④、添加zone记录
打开/etc/named.rfc1912.zones,添加如下记录:
zone “com” IN {
type master;
file “com.zone”;
};
⑤添加解析库文件并授权renzituo.com给下级子域,权限为640,属组named
touch /var/named/com.zone
$TTL 86400
@ IN SOA dns1 dns1adm (
2016070901
2h
10m
7d
1d )
IN NS dns1
renzituo.com. IN NS renzituodns1
renzituo.com. IN NS renzituodns2
dns1 IN A 192.168.10.3
renzituodns1 IN A 192.168.10.4
renzituodns2 IN A 192.168.10.5
www IN A 210.110.119.8
ftp IN CNAME www
4、搭建根服务器
①、在192.168.10.2主机上面安装bind程序
yum -y install bind
iptables -F
setenforce 0
②、配置为缓存服务器
打开/etc/named.conf配置文件做如下配置:
options {
listen-on port 53 { localhost; };
allow-query { any; };
recursion yes;
dnssec-enable no;
dnssec-validation no;
//bindkeys-file “/etc/named.iscdlv.key”;
//managed-keys-directory “/var/named/dynamic”;
};
区域类型:
zone “.” IN {
type master;
file “root.zone”;
};
③、创建区域解析库文件,权限为640,属组named
touch /var/named/root.zone
$TTL 86400
@ IN SOA dns1 dns1adm (
2016070901
2h
10m
7d
1d )
IN NS dns1
com. IN NS comdns1
dns1 IN A 192.168.10.2
comdns1 IN A 192.168.10.3
5、在192.168.10.6主机上安装bind程序
yum -y install bind
iptables -F
setenforce 0
①、将DNSserver 配置为缓存服务器
打开/etc/named.conf配置文件做如下配置:
options {
listen-on port 53 { localhost; };
allow-query { any; };
recursion yes;
dnssec-enable no;
dnssec-validation no;
//bindkeys-file “/etc/named.iscdlv.key”;
//managed-keys-directory “/var/named/dynamic”;
};
②、修改name.ca文件
将其根指向为192.168.10.2
. IN NS a.root-servers.net.
a.root-servers.net. IN A 192.168.10.2
6、在client主机上测试
dig www.renzituo.com @192.168.10.6
原创文章,作者:人字拖,如若转载,请注明出处:http://www.178linux.com/73412