1、安装
10.1.2.214的主机
1
|
yum
install
bind bind-util
|
2、主配置文件/etc/named.conf
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
61
62
63
|
//
//
named.conf
//
//
Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
//
server as a caching only nameserver (as a localhost DNS resolver only).
//
//
See
/usr/share/doc/bind
*
/sample/
for
example named configuration files.
//
options {
//
//
named.conf
//
//
Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
//
server as a caching only nameserver (as a localhost DNS resolver only).
//
//
See
/usr/share/doc/bind
*
/sample/
for
example named configuration files.
//
options {
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"
;
recursion
yes
;
/* 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"
;
|
3、在配置文件/etc/named.rfc1912.zones添加这段
1
2
3
4
5
6
7
8
|
zone
"dataeye.com"
IN {
type
master;
file
"abc.com.zone"
;
};
zone
"2.1.10.in-addr.arpa"
IN {
type
master;
file
"10.1.2.zone"
;
};
|
4、解析库文件在/var/named/目录下
4.1 /var/named/abc.com.zone$TTL 600
1
2
3
4
5
6
7
8
9
10
11
|
@ IN SOA ns.abc.com. admin.abc.com. (
2016021801
2H
10m
3D
1D )
IN NS ns
IN MX 10 mail
ns IN A 10.1.2.214
mail IN A 10.1.2.214
wwww IN A 10.1.2.214
|
4.2 /var/named/10.1.2.zone
1
2
3
4
5
6
7
8
9
10
11
|
$TTL 600
@ IN SOA ns.abc.com. admin.abc.com. (
2016021801
2H
10m
3D
1D )
IN NS ns.abc.com.
214 IN PTR ns.abc.com.
214 IN PTR mail.abc.com.
214 IN PTR www.abc.com.
|
4.3 修改属主named和权限640
1
2
|
#chgrp named abc.com.zone 10.1.2.zone
#chmod 640 abc.com.zone 10.1.2.zone
|
5、检查语法
1
2
|
#name-checkzone "abc.com" abc.com.zone
#named-checkzone "2.1.10.in-addr.arpa" 10.1.2.zone
|
6、验证
1
2
3
|
#dig -t MX abc.com @10.1.2.214
#dig -t A mail.abc.com @10.1.2.214
#dig -x 10.1.2.214 @10.1.2.214
|
本文转自 zouqingyun 51CTO博客,原文链接:http://blog.51cto.com/zouqingyun/1752690,如需转载请自行联系原作者