【问题标题】:cannot ping to ip base on host name无法根据主机名 ping 到 ip
【发布时间】:2012-05-12 19:08:06
【问题描述】:

我有两台电脑

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。

【问题讨论】:

  • zone "0.168.192.in-addr.arpa" 在你的反向 DNS 中最好是 zone "56.168.192.in-addr.arpa"...
  • 我的代码有问题,我已经把那个保留的 DNS 放在之前

标签: linux ubuntu dns


【解决方案1】:

在我看来,您缺少“simas.tes”的“IN A”条目。在 /etc/bind/zones/simas.tes.db 文件中。一种可能的设置是:

simas.tes。在 192.168.56.103
西马泰斯IN NS NS1.simas.tes.
在这个例子中,我添加了我在你现有的 NS 记录上面提到的“A”记录。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-23
    • 1970-01-01
    • 2013-02-10
    • 1970-01-01
    • 1970-01-01
    • 2021-08-13
    • 2020-08-02
    相关资源
    最近更新 更多