DNS总是失败
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
nameserver 192.168.17.7
# host shrike.jamond.net
解析失败
# 192.168.17.7
同样不行
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
1、看看/var/log/messages中有什麼錯沒有
2、把本機的DNS設為本機
dns配置完成后,要重新启动一下进程
2、把本機的DNS設為本機
怎么设?
配置后执行了
# service named restart
在eth0 ip地址中有一DNS
設為192.168.17.7
在用nslookup 試試
图形界面中Network - DNS - Primary DNS: 192.168.17.7
是这项吗?有的。
# nslookup
>; shrike.jamond.net
Server: 192.168.17.7
Address: 192.168.17.7#53
** servr can't find shrike.jamond.net: SERVFAIL
>; 192.168.17.7
Server: 192.168.17.7
Address: 192.168.17.7#53
** server can't find 7.17.168.192.in-addr.arpa: SERVFAIL
>; set all
Default server: 192.168.17.7
Address: 192.168.17.7
Set options:
novc nodebug nod2
search recurse
timeout = 0 retry = 2 port = 53
querytype = A class = IN
srchlist =
>;
日志
有沒看報什麼錯
# 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
將下面兩行, 併一行.
@ IN SOA shrike.jamond.net. root.shrike.jamond.net.
(