options {
listen-on port 53 { any; };//改为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; }; //改为 any
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* 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";
创建zone文件
# vim /etc/named.rfc1912.zones //添加正反向区域
// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
// and
// (c)2007 R W Franks
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
zone "localhost.localdomain" IN {
type master;
file "named.localhost";
allow-update { none; };
};
zone "localhost" IN {
type master;
file "named.localhost";
allow-update { none; };
};
注释以下几行
//zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
// type master;
// file "named.loopback";
// allow-update { none; };
//};
//zone "1.0.0.127.in-addr.arpa" IN {
// type master;
// file "named.loopback";
// allow-update { none; };
//};
zone "0.in-addr.arpa" IN {
type master;
file "named.empty";
allow-update { none; };
};
//添加正反向
zone "test.web" IN { // 这个 zone 的名称
type master; // 是什么类型
file "test.web.zone"; // zone文件名
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "1.168.192.zone";
};
#vim /var/named/test.web.zone
$TTL 86400
@ IN SOA ns.test.web. root.test.web. ( # ns.test.web. 是DNS服务器的名称 root 是管理员的邮箱地址, root.test.web.等价于 root@test.web
42 ; serial (d. adams) 仅作为序列号而已
3H ; refresh 服务器的更新时间
15M ; retry 重新更新时间间隔
1W ; expiry 多久之后宣布失败
1D ) ; minimum 相当于缓存记忆时间
@ IN NS ns.test.web.
@ IN MX 10 mail.test.web.
ns IN A 192.168.1.8
www IN A 192.168.1.8
mail IN A 192.168.1.8
#vim /var/named/1.168.192.zone