1.[root@zh888 ~]#yum -y install bind* //用yum安装所有bind软件
2.[root@zh888 ~]# rpm -qa|grep bind//查询bind安装的所有软件
bind-9.7.3-8.P3.el6_2.2.i686
bind-libs-9.7.3-8.P3.el6_2.2.i686
bind-sdb-9.7.3-8.P3.el6_2.2.i686
bind-devel-9.7.3-8.P3.el6_2.2.i686
bind-utils-9.7.3-8.P3.el6_2.2.i686
3.[root@zh888 ~]# cat /etc/named.conf //查看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 { any; }; // 开启侦听端口53,接受任意IP连接
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 { 0.0.0.0/0; }; //// 允许任意IP查询这里也可以修改为any如果不修改会在nslookup出现错误refused被拒绝
forward only; //增加转发功能
forwarders {
202.101.172.35; //浙江DNS服务器地址
202.101.172.46;};
recursion yes;
dnssec-enable yes;
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;
file "named.ca";
};
include "/etc/named.rfc1912.zones"; //主要配置文件
4.// named.rfc1912.zones:///etc/named.rf1912.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 http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-02.txt
// (c)2007 R W Franks
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//