1.安装
#yum install bind bind-utils bind-libs
2.配置/etc/named.conf
options {
directory "/etc";
pid-file "/var/run/named/named.pid";
};
zone "."{
type hint;
file "/var/named/named.ca";
};
zone "localhost"{
type master;
file "/var/named/localhost.zone";
};
zone "0.0.127.in-addr.arpa"{
type master;
file "/var/named/localhost.rev";
};
zone "test.com" {
type master;
file "/var/named/test.com.zone";
};
zone "1.168.192.in-addr.arpa" {
type master;
file "/var/named/test.com.rev";
};
3.配置/var/named/localhost.zone
$TTL 86400
@ IN SOA localhost. root.localhost. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS localhost.
IN A 127.0.0.1
4.配置/var/named/localhost.rev
$TTL 86400
@ IN SOA localhost. root.localhost. (
1
28800
14400
3600000
86400
)
IN NS localhost.
1 IN PTR localhost.
5.配置/var/named/test.com.zone
$TTL 86400
@ IN SOA zimbraserver.test.com. root.localhost. (
1
28800
14400
3600000
86400
)
IN NS zimbraserver.test.com.
zimbraserver.test.com IN MX 10 zimbraserver.test.com. ;指定邮件交换记录
zimbraserver IN A 192.168.1.134
6.配置/var/named/test.com.rev
$TTL 86400
@ IN SOA zimbraserver.test.com. root.localhost. (
1
28800
14400
3600000
86400
)
IN NS zimbraserver.test.com.
134 IN PTR zimbraserver.test.com. ;反向解析IP地址