|
|
我用rh9,在练习dns的配置,
大体情况如下:
局域网内一台主机,即当DNS服务器,又当www服务器,Ip:192.168.10.160,希望解析www.du.com
代码:
/etc/named.config
zone "10.168.192.in-addr.arpa" {
type master;
file "du.local";
};
zone "du.com" {
type master;
file "du.zone";
};
代码:
/var/named/du.local
$TTL 86400
@ IN SOA www.du.com. root.loclhost. (
2 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
86400 ; ttk
)
@ IN NS www.du.com.
160 IN PTR www.du.com.
代码:
/var/named/du.zone
$TTL 86400
@ 1D IN SOA www.du.com. root.localhost. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
1D IN NS my.du.com
www 1D IN A 192.168.10.160
之后,
# /sbin/service named reload
#host www.du.com
www.du.com has address 192.168.10.160
#ping www.du.com
PING www.du.com (192.168.10.160) 56(84) bytes of data.
64 bytes from www.du.com (192.168.10.160): icmp_seq=1 ttl=64 time=0.015 ms
64 bytes from www.du.com (192.168.10.160): icmp_seq=2 ttl=64 time=0.024 ms
64 bytes from www.du.com (192.168.10.160): icmp_seq=3 ttl=64 time=0.023 ms
64 bytes from www.du.com (192.168.10.160): icmp_seq=4 ttl=64 time=0.022 ms
我也开了apache
在浏览器里访问http://localhost,http://127.0.0. ... .du.com无法访问.
请大家教教我.感激不尽!!! |
|