当前位置: 技术问答>linux和unix
DNS总是失败
来源: 互联网 发布时间:2015-09-30
本文导语: 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....
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
同样不行
一块虚拟网卡,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
同样不行
|
我昨天刚学的DNS,给你提一点建议,不一定正确.
在named.conf文件中我觉得应该是这样:在
file "jamond.net.hosts";语句后面,似乎应该加上
allow-update{ none;}; 这一句.
同样在 file "192.168.17.rev"; 后面也应该加上这一句.
另外, 你的 zone "17.168.192.in-add.arpa" { 这一句也有错误,应该是
zone "17.168.192.in-addr.arpa" IN { .
还有你的resolv.conf 应该是
search jamond.net
nameserver 192.168.17.7
还有你的主机名必须是shrike.
建好之后先看一下network是否工作正常.
ping 192.168.17.7 看能否通,然后再重启named服务,然后再执行rndc reload
然后再看看能否通,祝好运.
在named.conf文件中我觉得应该是这样:在
file "jamond.net.hosts";语句后面,似乎应该加上
allow-update{ none;}; 这一句.
同样在 file "192.168.17.rev"; 后面也应该加上这一句.
另外, 你的 zone "17.168.192.in-add.arpa" { 这一句也有错误,应该是
zone "17.168.192.in-addr.arpa" IN { .
还有你的resolv.conf 应该是
search jamond.net
nameserver 192.168.17.7
还有你的主机名必须是shrike.
建好之后先看一下network是否工作正常.
ping 192.168.17.7 看能否通,然后再重启named服务,然后再执行rndc reload
然后再看看能否通,祝好运.