原创作品,允许转载,转载时请务必以超链接形式标明文章
原始出处 、作者信息和本声明。否则将追究法律责任。
http://navyaijm.blog.51cto.com/4647068/1698305
1
|
CentOS release 6.5 (Final)
|
1
2
|
bind-libs-9.8.2-0.37.rc1.el6.x86_64bind-9.8.2-0.37.rc1.el6.x86_64
bind-utils-9.8.2-0.37.rc1.el6.x86_64
|
1
2
|
10.10.66.121 主
10.10.66.122 从
|
1
|
yum -y
install
bind-libs bind-utils bind
|
1
2
3
4
|
mkdir
/data/named/
mkdir
/data/log/named/
chown
named:named
/data/named/
-R
chown
named:named
/data/log/named/
-R
|
1
|
cp
-r
/var/named/
*
/data/named/
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
acl wx {
10.57.66.0
/24
;
};
acl zw {
10.10.2.0
/24
;
};
options {
listen-on port 53 { any; };
directory
"/data/named"
;
dump-
file
"/data/named/data/cache_dump.db"
;
statistics-
file
"/data/named/data/named_stats.txt"
;
memstatistics-
file
"/data/named/data/named_mem_stats.txt"
;
dnssec-
enable
no;
allow-query { wx;zw; };
allow-transfer { 10.10.66.122; };
#从库无需配置此参数
also-notify { 10.10.66.122; };
#从库无需配置此参数
recursion
yes
;
notify
yes
;
#从库无需配置此参数
tcp-clients 1000;
};
controls{
inet 0.0.0.0 port 953
allow { localhost; } ;
};
logging {
category
"default"
{
"normal"
; };
category
"general"
{
"normal"
; };
category
"database"
{
"normal"
; };
category
"security"
{
"normal"
; };
category
"config"
{
"normal"
; };
category
"resolver"
{
"normal"
; };
category
"xfer-in"
{
"normal"
; };
category
"xfer-out"
{
"normal"
; };
category
"notify"
{
"normal"
; };
category
"client"
{
"normal"
; };
category
"unmatched"
{
"normal"
; };
category
"network"
{
"normal"
; };
category
"update"
{
"normal"
; };
category
"queries"
{
"normal"
; };
category
"dispatch"
{
"normal"
; };
category
"dnssec"
{
"normal"
; };
category
"lame-servers"
{
"normal"
; };
channel
"normal"
{
file
"/data/log/named/normal.log"
versions 3 size 200m;
severity debug 0;
print-
time
yes
;
print-category
yes
;
print-severity
yes
;
};
};
zone
"."
IN {
type
hint;
file
"named.ca"
;
};
include
"/etc/named.rfc1912.zones"
;
include
"/etc/named.root.key"
;
|
1
2
3
4
5
|
zone
"cmredis.com"
{
type
master;
file
"cmredis.com.zone"
;
allow-update { none; };
};
|
1
2
3
4
5
6
|
zone
"cmredis.com"
{
type
slave;
masters {10.10.66.121;};
file
"slaves/cmredis.com.zone"
;
allow-update { none; };
};
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
vim
/data/named/cmredis
.com.zone
$TTL 60
@ IN SOA cmredis.com. root (
53 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS ns.cmredis.com.
@ IN NS dns2.cmredis.com.
ns IN A 127.0.0.1
dns 1200 IN A 10.10.66.121
dns2 1200 IN A 10.10.66.122
|
1
2
|
named-checkzone cmredis.com.zone
/data/named/cmredis
.com.zone
/etc/init
.d
/named
configtest
|
1
2
|
/etc/init
.d
/named
start
chkconfig named on
|