#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
> www.test.com
Server: 192.168.10.180
Address: 192.168.10.180#53
www.test.com 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配置成功.
![nixsky[www.nixsky.com]](/templets/images/toplogo.gif)

