/etc/bind/named.conf.options:
options {
listen-on port 53 { any; }; // 监听在主机的53端口上。any代表监听所有的主机
directory "/var/named"; // 如果此档案底下有规范到正反解的zone file 档名时,该档名预设应该放置在哪个目录底下
// 下面三项是服务的相关统计信息
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; }; // 谁可以对我的DNS服务器提出查询请求。any代表任何人
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
forwarders { // 指定上层DNS服务器
114.114.114.114;
};
bindkeys-file "/etc/named.iscdlv.key";
//managed-keys-directory "/var/named/dynamic";
};
/etc/bind/named.conf:
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
//include "/etc/bind/named.conf.default-zones";
/etc/bind/named.conf.local
zone "u.com" IN {
type master;
file "/etc/bind/u.com.zone";
};
/etc/bind/u.com.zone
$TTL 86400
@ IN SOA ns.u.com. root (
1 ; serial
1D ; refresh
1H ; retry
1W ; expire
0 ) ; minimum
@ IN NS ns.u.com.
ns IN A 192.168.1.219
www IN A 1.1.1.1
g IN A 1.1.1.1