我有两台PC
1. 192.168.56.102 => winXP
2. 192.168.56.103 => ubuntu 10.04 (bind9 and apache2 installed)
我已将simas.tes注册为192.168.56.103
我做了什么:# vi /etc/bind/named.conf.local
zone "simas.tes" {
type master;
file "/etc/bind/zones/simas.tes.db";
};
zone "56.168.192.in-addr-arpa" {
type master;
file "/etc/bind/zones/rev.56.168.192.in-addr.arpa";
};
然后:
# vi /etc/bind/zones/simas.tes.db
simas.tes. IN SOA ns1.simas.tes. admin.simas.tes. (
2006081401
28800
3600
604800
38400
)
simas.tes. IN NS NS1.simas.tes.
simas.tes. IN MX 10 mta.simas.tes.
www IN A 192.168.56.103
mta IN A 192.168.56.103
ns1 IN A 192.168.56.103
然后:
# vi /etc/bind/zones/rev.56.168.192.in-addr.arpa
@ IN SOA ns1.simas.tes. admin.simas.tes. (
2006081401;
28800;
604600;
604800;
86400
)
IN NS ns1.simas.tes.
103 IN PTR simas.tes.
我的挖掘状态:
root@my-ubuntu:/var/www# dig simas.tes
; <<>> DiG 9.7.0-P1 <<>> simas.tes
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 9559
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;simas.tes. IN A
;; AUTHORITY SECTION:
simas.tes. 38400 IN SOA ns1.simas.tes. admin.simas.tes. 2006081401 28800 3600 604800 38400
;; Query time: 0 msec
;; SERVER: 192.168.56.103#53(192.168.56.103)
;; WHEN: Thu May 3 17:25:05 2012
;; MSG SIZE rcvd: 73
我的nslookup状态:
root@my-ubuntu:/var/www# nslookup simas.tes
Server: 192.168.56.103
Address: 192.168.56.103#53
*** Can't find simas.tes: No answer
现在我可以从192.168.56.102(我的winXP)访问simas.tes网站,但我无法ping到simas.tes(而不是192.168.56.103).. 我想念的是什么? ..我只是想知道如何成功ping simas.tes。
答案 0 :(得分:2)
在我看来,你错过了“simas.tes”的“IN A”条目。在/etc/bind/zones/simas.tes.db文件中。设定的一种可能性是:
simas.tes. IN A 192.168.56.103 simas.tes. IN NS NS1.simas.tes.在这个例子中,我添加了上面提到的现有NS记录中的“A”记录。