正反向解析区域文件 /var/named/chroot/var/named/
模板在/var/named/
修改主机名 FQDN 样式:1.hostname instructor.example.com
2.vim /etc/hosts
3.vim /etc/sysconfig/network
/etc/hosts //本机解析记录
/etc/resolv.conf dns //服务器地址
/etc/nsswitch.conf //resolv.conf 与 hosts 的优先级
hosts: files dns
默认生成:/etc/named.conf
//
// 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; }; //监听端口,IP 改成 serverIP 192.168.0.254; 127.0.0.1; or any;
listen-on-v6 port 53 { ::1; }; //IP v6 的暂时不用
directory "/var/named"; //zone 目录,相对于/chroot
dump-file "/var/named/data/cache_dump.db"; //设定缓存文件转储位置
statistics-file "/var/named/data/named_stats.txt"; //设定 DNS 的统计信息
memstatistics-file "/var/named/data/named_mem_stats.txt"; //内存使用情况记录
query-source port 53; //查询端口
query-source-v6 port 53;
allow-query { localhost; 192.168.0.0/24; };
//允许查询的 client.修改成本地网段 192.168.0.0/24 或 0.0.0.0/0;或 any;
allow-transfer { none; 192.168.0.254; }; //设定 slave 不传送 zone[有 slave DNS 时打开],添加
设置可以给该 IP 地址的 DNS 主机传送这个区域的区配文件也可以不用设置,那么所有 Slave DNS 的主机都可以从这里获取
recursion yes; //递归查询
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
forward only; //只允許 forward![ Cache-Only 主机设置],添加
评论0