#vim /var/named/linuxidc.com.zone
$TTL 1D
@ IN SOA master.linuxidc.com. email.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS master
master IN A 192.168.153.130
www IN A 192.168.153.129
nginx IN A 192.168.153.129
bbs IN A 192.168.153.129
3.配置完成后,检查配置文件的正确性:
[root@localhost ~]# /usr/sbin/named-checkconf -z
zone linuxidc.com/IN: loaded serial 0
zone 153.168.192.in-addr.arpa/IN: loaded serial 2010110901
zone localhost.localdomain/IN: loaded serial 0
zone localhost/IN: loaded serial 0
zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0
zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
zone 0.in-addr.arpa/IN: loaded serial 0
4.重启服务:
[root@localhost ~]# /sbin/service named restart
Stopping named: .[ OK ]
Starting named: [ OK ]
5.nslookup解析测试:
[root@localhost ~]# nslookup
> master.linuxidc.com
Server: 192.168.153.130 //dns地址
Address: 192.168.153.130#53
Name: master.linuxidc.com //域名服务器主机名
Address: 192.168.153.130
>
Server: 192.168.153.130
Address: 192.168.153.130#53
Name:
Address: 192.168.153.129 //www域名对应的A记录地址
> nginx.linuxidc.com
Server: 192.168.153.130
Address: 192.168.153.130#53
Name: nginx.linuxidc.com
Address: 192.168.153.129
> bbs.linuxidc.com
Server: 192.168.153.130
Address: 192.168.153.130#53
Name: bbs.linuxidc.com
Address: 192.168.153.129
>
单台DNS主服务器应用实验之反向解析:
1.配置主区域数据文件(/etc/named.conf),追加反向解析如下内容:
zone "153.168.192.in-addr.arpa" IN{
type master;
file "192.168.153.arpa.zone";
allow-update { none; };
};
2.配置解析数据文件.