标签:sha 数据文件 序列号 删除 服务器 color ndk 多个 rndc
DNS服务?
?
?
?
只提供域名解析结果的缓存功能,目的在于提高数据查询速度和效率,但是没有自己控制的区域地址数据。构建缓存域名服务器时,必须设置根域或指定其他DNS服务器作为解析来源。
?
维护某一个特定DNS区域的地址数据库,对其中的解析记录具有自主控制权,是指定区域中唯一存在的权威服务器、官方服务器。构建主域名服务器时,需要自行建立所有负责区域的地址数据文件。
?
?
?
当客户机向DNS服务器发出解析请求,DNS服务器从服务器本地的唯高速缓存中查询出结果,反馈给客户机,此过程称为递归查询
?
?
?
?
?
name: 当前区域的名字,例如“xxx.com.”
value: 有多部分组成
(1) 当前区域的主DNS服务器的FQDN,也可以使用当前区域的名字;
(2) 当前区域管理员的邮箱地址;但地址中不能使用@符号,一般用.替换,例如 linuxedu.magedu.com
(3) 主从服务区域传输相关定义以及否定的答案的统一的TTL
$TTL 1D
@ IN SOA @ admin.xxx.com. (
0 ; serial 序列号
1D ; refresh 刷新时间
1H ; retry 重试时间
1W ; expire 过期时间
3H ) ; minimum 否定答案的TTL值
$TTL 1D
@ IN SOA @ xxx.com. admin.xxx.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
xxx.com. NS ns1.xxx.com.
ns1.xxx.com. A 192.168.172.129
$TTL 1D
@ IN SOA xxx.com. . admin.magedu.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ NS ns1.xxx.com.
192.168.172.129 PTR ns1.xxx.com.
name: 当前区域的名字
value: 当前区域的某DNS服务器的名字
注意:一个区域可以有多个NS记录
例如:
xxx.com. IN NS ns1.xxx.com.
xxx.com. IN NS ns2.xxx.com.
注意:
(1) 相邻的两个资源记录的name相同时,后续的可省略
(2) 对NS记录而言,任何一个ns 记录后面的服务器名字,都应该在后续有一个A记录
?
?
准备条件:192.168.0.254为主服务器,192.168.0.253为从服务器
[root@centos6 ~]# yum -y install bind\
[root@centos6 ~]# vim /etc/named.conf
options {
listen-on port 53 { any; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { any; };
allow-transfer { 192.168.0.253; };#授权才可以做从服务器
zone "." IN {
type hint;
file "named.ca";
};
zone "alice.com" IN {
type master;
file "named.alice.com";
};
zone "0.168.192.in-addr-arpa" IN {
type master;
file "named.192.168.0";
};
};
[root@centos6 ~]# vim /var/named/named.alice.com $TTL 1D
@ IN SOA master.alice.com. rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ IN NS master.alice.com.
master.alice.com. IN A 192.168.0.254
@ IN NS slave.alice.com.
slave.alice.com. IN A 192.168.0.253
client.alice.com. IN A 192.168.0.10
[root@centos6 ~]# vim /var/named/named.192.168.0
$TTL 1D
@ IN SOA master.alice.com. rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ NS master.alice.com.
@ NS slave.alice.com.
254 IN PTR master.alice.com.
253 IN PTR slave.alice.com.
10 IN PTR client.alice.com.
[root@centos6 ~]# service named start
Starting named: [ OK ]
[root@centos6 ~]# vim /etc/named.conf
options {
listen-on port 53 { any; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { any; };
zone "." IN {
type hint;
file "named.ca";
};
zone "alice.com" IN {
type master;
file "slaves/named.alice.com";
};
zone "0.168.192.in-addr-arpa" IN {
type master;
file "slaves/named.192.168.0";
};
[root@centos6 named]# ll
total 40
-rw-r-----. 1 root named 230 Sep 15 05:25 192.168.172.zone
drwxrwx---. 2 named named 4096 Sep 16 03:41 data
drwxrwx---. 2 named named 4096 Sep 16 04:24 dynamic
-rw-r-----. 1 root named 3171 Jan 11 2016 named.ca
-rw-r-----. 1 root named 713 Sep 15 21:13 named.ca.rpmsave
-rw-r-----. 1 root named 152 Dec 15 2009 named.empty
-rw-r-----. 1 root named 152 Jun 21 2007 named.localhost
-rw-r-----. 1 root named 168 Dec 15 2009 named.loopback
drwxrwx---. 2 named named 4096 Sep 16 04:52 slaves
?
?
准备条件:
client:192.168.153.5
caching: 192.168.153.10
. : 192.168.152.9
com: 192.168.153.8
magedu: master 192.168.153.7 slave 192.168.153.6
[root@centos6 ~]# yum -y install bind;setenforce 0;iptables -F
安装bind的服务器的配置文件
options {
listen-on port 53 { any; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { any; };
recursion no;#caching服务器写为yes
dnssec-enable no;
dnssec-validation no;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
[root@centos6 ~]# vim /var/named/named.ca
. 3600000 NS A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET. 3600000 A 192.168.153.9
配置.服务器
a. name.conf中删除name.ca的项目
b. rfc1912文件
zone "." IN {
type master;
file "root.zone";
};
c. root.zone
$TTL 1D
@ IN SOA ns. admin. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS ns.
ns. A 192.168.153.9
com. NS ns.com.
ns.com. A 192.168.153.8
d.启动named
配置主magedu.com
a. rfc1912文件
zone "magedu.com" IN {
type master;
file "magedu.com.zone";
};
b. magedu.com.zone
$TTL 1D
@ IN SOA ns1.magedu.com. rname.invalid. (
2018091301 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS ns1.magedu.com.
NS ns2.magedu.com.
A 192.168.153.7
ns2 A 192.168.153.6
www A 1.1.1.1
ftp A 2.2.2.2
[root@centos6 ~]# vim /etc/resolv.conf
domain magedu.com
search magedu.com localdomain
nameserver 172.18.0.1
nameserver 192.168.172.1
nameserver 192.168.153.10 #指向缓存caching
测试
[root@localhost ~]# nslookup ftp.magedu.com
Server: 192.168.83.132
Address: 192.168.83.132#53
Non-authoritative answer:
Name: ftp.magedu.com
Address: 2.2.2.2
[root@localhost ~]# nslookup hsh.magedu.com
Server: 192.168.83.132
Address: 192.168.83.132#53
Non-authoritative answer:
Name: hsh.magedu.com
Address: 10.10.10.10
标签:sha 数据文件 序列号 删除 服务器 color ndk 多个 rndc
原文地址:http://blog.51cto.com/13805636/2175722