QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1534|回复: 6

DNS总是失败

[复制链接]
发表于 2005-5-25 13:00:35 | 显示全部楼层 |阅读模式
VMware 5.0 + CentOS 3.4
一块虚拟网卡,Host-only,手动配置:
192.168.17.7
255.255.255.0

按照书上的配置,不能解析,请高人多多指教
# vi /etc/named.conf
添加:
zone "jamond.net" {
        type master;
        file "jamond.net.hosts";
};

zone "17.168.192.in-add.arpa" {
        type master;
        file "192.168.17.rev";
};

# vi /var/named/jamond.net.hosts

$ttl 1D
@        IN        SOA        shrike.jamond.net.        root.shrike.jamond.net.
(
        1053891162
        3H
        15M
        1W
        1D )
       
        IN        NS        shrike.jamond.net.
        IN        MX        5        shrike.jamond.net.

shrike        IN        A        192.168.17.7

www        IN        CNAME        shrike.jamond.net.

# vi /var/named/192.168.17.rev

$ttl 1D
@        IN        SOA        shrike.jamond.net.        root.shrike.jamond.net.
(
        1053892104
        1053892104
        3H
        15M
        1W
        1D )

        IN        NS        shrike.jamond.net.

7        IN        PTR        shrike.jamond.net.

# vi /etc/resolv.conf
 楼主| 发表于 2005-5-25 13:00:59 | 显示全部楼层
nameserver 192.168.17.7


# host shrike.jamond.net
解析失败
# 192.168.17.7
同样不行
回复

使用道具 举报

发表于 2005-5-25 13:46:01 | 显示全部楼层
失败、不行,错误信息是什么?!

1. 确定服务已经正常启动
2. 确定服务可以正常访问
3. 用 dig host_name 或者 host -d/-v hostname 可以得到更详细输出。
回复

使用道具 举报

 楼主| 发表于 2005-5-25 14:41:21 | 显示全部楼层
# host shrike.jamond.net
Host shrike.jamond.net not found: 2(SERVFAIL)

# host 192.168.17.7
Host 7.17.168.192.in-addr.arpa not found: 2(SERVFAIL)

# dig host_name
; <<>> DiG 9.2.4 <<>> host_name
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 1432
;; flages: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
; host_name. IN A

;; Query time: 29 msec
;; SERVER: 192.168.17.7#53(192.168.17.7)
;; WHEN: Wed May 25 14:24:28 2005
;; MSG SIZE rcvd: 27

# host -d hostname
Trying "hostname"
Host hostname not found: 2(SERVFAIL)
Received 26 bytes from 192.168.17.7#53 in 27 ms

# host -v hostname
Trying "hostname"
Host hostname not found: 2(SERVFAIL)
Received 26 bytes from 192.168.17.7#53 in 11 ms
回复

使用道具 举报

 楼主| 发表于 2005-5-25 20:11:06 | 显示全部楼层
# service named stop
# tail -f /var/log/messages
May 25 19:43:20 rh3 named[1351]: zone localhost/IN: loaded serial 42
May 25 19:43:20 rh3 named[1351]: dns_rdata_fromtext: jamond.net.hosts:2: near eol: unexpected end of input
May 25 19:43:20 rh3 named[1351]: zone jamond.net/IN: loading master file jamond.net.hosts: unexpected end of input
May 25 19:43:37 rh3 named[1351]: running
May 25 19:43:37 rh3 named[1351]: shutting down: flushing changes
May 25 19:43:37 rh3 named[1351]: stopping command channel on 127.0.0.1#953
May 25 19:43:37 rh3 named[1351]: no longer listening on 127.0.0.1#53
May 25 19:43:37 rh3 named[1351]: no longer listening on 192.168.17.7#53
May 25 19:43:37 rh3 named[1351]: exiting
May 25 19:43:37 rh3 named:    succeeded

# service named start
# tail -f /var/log/messages
May 25 19:44:43 rh3 named[1387]: zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
May 25 19:44:43 rh3 named[1387]: dns_rdata_fromtext: 192.168.17.rev:2: near eol: unexpected end of input
May 25 19:44:43 rh3 named[1387]: zone 17.168.192.in-addr.arpa/IN: loaded serial 42
May 25 19:44:43 rh3 named[1387]: zone 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 1997022700
May 25 19:44:43 rh3 named[1387]: zone localdomain/IN: loaded serial 42
May 25 19:44:43 rh3 named[1387]: zone localhost/IN: loaded serial 42
May 25 19:44:43 rh3 named[1387]: dns_rdata_fromtext: jamond.net.hosts:2: near eol: unexpected end of input
May 25 19:44:43 rh3 named[1387]: zone jamond.net/IN: loading master file jamond.net.hosts: unexpected end of input
May 25 19:44:43 rh3 named[1387]: running
回复

使用道具 举报

 楼主| 发表于 2005-5-26 09:57:11 | 显示全部楼层
將下面兩行, 併一行.
@ IN SOA shrike.jamond.net. root.shrike.jamond.net.
(

反向删除一行1053892104

均可以正常工作了
回复

使用道具 举报

发表于 2005-5-27 21:10:25 | 显示全部楼层
[quote:e9a61c1d40="tails"]...
zone jamond.net/IN: loading master file jamond.net.hosts: unexpected end of input
...[/quote] 本版已经有过多次同样的问题了,真不知道你们看的都是哪本烂书?!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-5 20:46 , Processed in 0.039076 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表