//
// 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 { // 定义全局变量
listen-on port 53 { 127.0.0.1; }; // ipv4 监听端口
listen-on-v6 port 53 { ::1; }; // ipv6 监听端口
directory "/var/named"; // 制定装载zone区域文件的目录
dump-file "/var/named/data/cache_dump.db"; // cache
statistics-file "/var/named/data/named_stats.txt"; // statistics
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { localhost; }; // 允许访问列表
recursion yes; //递归查询
dnssec-enable yes; //DNS确保应答报文的完整性
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
}; // "}"后也得分号结束
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN { // "."代表根区域
type hint; // 根区域的类型就为hint
file "named.ca"; // 指定zone文件,默认已经生成
};
include "/etc/named.rfc1912.zones"; //存放自定义的区域文件
备注:配置文件总体来说分为三大块选项、日志、区域
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx