1、安装软件包
[[email protected] ~]# yum install bind*
2、编辑配置文件
[[email protected] ~]# more /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; 10.20.20.66; }; 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 { localhost; 10.20.20.0/24;}; 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"; }; zone "****.local" IN { type master; file "forward.testlocal"; allow-update {none;}; }; zone "20.20.10.in-addr.arpa" IN { type master; file "reverse.testlocal"; allow-update {none;}; }; include "/etc/named.rfc1912.zones"; include "/etc/named.root.key";
3、编辑正向文件
[[email protected] ~]# more /var/named/forward.testlocal $TTL 86400 @ IN SOA dns01.****.local. root.dns01.test.local. ( 2011071001 ;Serial 3600 ;Refresh 1800 ;Retry 604800 ;Expire 86400 ;Minimum TTL ) @ IN NS dns01.test.local. @ IN A 10.20.20.66 dns01 IN A 10.20.20.66
4、编辑反向文件
[[email protected] ~]# more /var/named/reverse.testlocal $TTL 86400 @ IN SOA dns01.****.local. root.dns01.test.local. ( 2011071001 ;Serial 3600 ;Refresh 1800 ;Retry 604800 ;Expire 86400 ;Minimum TTL ) @ IN NS dns01.test.local. @ IN PTR test.local. dns01 IN A 10.20.20.66 66 IN PTR dns01.test.local.
5、启动服务
service named start chkconfig named on
6、DNS log配置,将bind的log方式进行如下设定,注意一下/var/named的目录写入权限
//logging { // channel default_debug { // file "data/named.run"; // severity dynamic; // }; //}; logging { channel bind_log { file "bind.log" versions 3 size 20m; severity info; print-time yes; print-category yes; }; category queries { bind_log; }; };
参考链接:
http://onlyzq.blog.51cto.com/1228/546630/
http://www.mamicode.com/info-detail-493643.html
时间: 2025-01-16 09:07:55