//
// 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.
//
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
3. vi /etc/named.rfc1912.zones
修改/etc/named.rfc1912.zones文件,添加testabc.com的正向区域 (反向区域我就不添加了,也没多大作用)
// named.rfc1912.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-dra ... -local-zones-02.txt
// (c)2007 R W Franks
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
//testabc.com的正向区域 前面很多localhost的全部删除
zone "testabc.com" IN {
type master;
file "named.testabc.com";
allow-update { none; };
};
4. 创建正向和反向区域资源文件
在配置named.conf时,指明的资源文件目录是/var/named,故先进入该目录。
# cd /var/named
# vi named.testabc.com
$TTL 1D
@ IN SOA ns.testabc.com. root ( ;这里的格式严格按照这个来
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H) ; minimum
@ IN NS ns.testabc.com 这个地方有时候只需要填@ IN NS ns 就行了 不知道为什么
ns IN A 1.2.3.4 ;这里的IP就是你自己填了
www IN A 1.2.3.4
5. 启动named服务
#service named start
至此,DNS服务器端的配置已完成,下面我们稍微配置一下客户端来测试我们的DNS服务器是否正常工作。