一.先从 下载最新bind,我下载的是
bind-9.3.3.tar.gz
二.安装配置
#gunzip -c bind-9.3.3.tar.gz | tar xvf - ;解压bind文件
#cd bind-9.3.3
#make
#make install
#cd /etc
#vi named.conf ;编辑named配置文件
////////////////////////////////////////////////////////////////
# primary server for test.com.
#
options {
directory "/var/named";
forwarders {
210.13.41.1; ;定义转发器
203.93.18.1; ;
};
forward first;
};
zone "." {
type hint;
file "named.root";
};
zone "test.com" in {
type master;
file "test.zone";
};
zone "10.168.192.in-addr.arpa" in {
type master;
file "test.rzone";
};
zone "0.0.127.in-addr.arpa" in {
type master;
file "localhost.rzone";
};
///////////////////////////////////////////////////////////////
#mkdir /var/named ;创建named区文件目录
#cd /var/named
#dig > named.root ;生成named.root文件
#vi localhost.rzone ;编辑本地发向解析文件
$TTL 86400
@ IN SOA server.test.com. root.server.test.com. (
20007011608 ; Serial
10800 ; Refresh - 3 hours
3600 ; Retry - 1 hour
432000 ; Expire - 1 week
86400) ; Minimum - 1 day
IN NS server.test.com.
1 IN PTR localhost.
//////////////////////////////////////////////////////////////
#vi test.zone ;编辑test.com正向解析文件
$TTL 86400
@ IN SOA server.test.com. root.server.test.com. (
2007011608 ; Serial
10800 ; Refresh - 3 hours
3600 ; Retry - 1 hour
432000 ; Expire - 1 week
86400) ; Minimum - 1 day
IN NS server.test.com.
; name ttl class type data
localhost IN A 127.0.0.1
server IN A 192.168.10.180
test2 IN A 192.168.10.22
test3 IN A 192.168.10.23
test4 IN A 192.168.10.24
test5 IN A 192.168.10.25
; Aliases
mail IN CNAME server
www IN CNAME server
;
; Domain mailing addresses
;
test.com. IN MX 2 server.test.com.
////////////////////////////////////////////////////////////
#vi test.rzone ; 编辑test.com反向解析文件
$TTL 86400
@ IN SOA server.test.com. root.server.test.com. (
2007011608 ; Serial
10800 ; Refresh - 3 hours
3600 ; Retry - 1 hour
432000 ; Expire - 1 week
86400) ; Minimum - 1 day
IN NS server.test.com.
;
; Machines names
;
180 IN PTR server.test.com.
22 IN PTR test2.test.com.
23 IN PTR test3.test.com.
24 IN PTR test4.test.com.
25 IN PTR test5.test.com.
///////////////////////////////////////////////////////////////
三.更改相关配置文件
#vi /etc/hosts
127.0.0.1 localhost
192.168.10.180 itrus-test5 test.com loghost
#cp /etc/nsswitch.dns /etc/nsswitch.conf ;使
#vi /etc/resolv.conf ;DNS
search test.com ;配置
nameserver 192.168.10.180 ;生效
四.启动DNS的deamon
#/usr/sbin/in.named &
五.测试
#nslookup
>
Server: 192.168.10.180
Address: 192.168.10.180#53
canonical name = server.test.com.
Name: server.test.com
Address: 192.168.10.180
> mail.test.com
Server: 192.168.10.180
Address: 192.168.10.180#53
mail.test.com canonical name = server.test.com.
Name: server.test.com
Address: 192.168.10.180
> 192.168.10.180
Server: 192.168.10.180
Address: 192.168.10.180#53
180.10.168.192.in-addr.arpa name = server.test.com.
> 127.0.0.1
Server: 192.168.10.180
Address: 192.168.10.180#53
1.0.0.127.in-addr.arpa name = localhost.
> localhost
Server: 192.168.10.180
Address: 192.168.10.180#53
Name: localhost.test.com
Address: 127.0.0.1
测试结果显示正向 反向 本地解析正常,DNS配置成功.
阅读(1899) | 评论(0) | 转发(0) |