免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1698 | 回复: 2
打印 上一主题 下一主题

我搭建的DNS无法解析配置好的本地域名![已在新手区解决] [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-05-16 15:34 |只看该作者 |倒序浏览
本帖最后由 w80286 于 2010-06-16 10:35 编辑

不好意思,我开始把帖子发在新手区,但问题一直没有解决,所以发来服务版了。

各位,我在学习搭建dns,用的CENTOS 5.4的OS,现在named能正常启动了,但是我已经配置好的域名查询不到,请各位帮忙看看又是哪里出问题了,谢谢。

[root@localhost etc]# cat named.conf
options
{directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_sats.txt";
pid-file "/var/run/named/named.pid";
forwarders {61.139.2.69;8.8.8.8;};
allow-query {any;};
allow-transfer {none;};
};

include "/etc/rndc.key";
zone "."{
type hint;
file "named.root";
};

zone "localhost"{
type master;
file "named.localhost";
};

zone "0.0.127"  {
type master;
file "named.127.0.0";
};


zone "test.com"  {
type master;
file "named.test.com";
};

zone "70.196.222"{
type master;
file "named.222.196.70";
};



[root@localhost named]# cat named.test.com
$TTL 600
@ IN SOA  test.com.  root.test.com.(2006102003 28800 14400 72000 86400)
@ IN NS test.com.
IN A 222.196.70.38

[root@localhost named]# cat named.222.196.70
$TTL 600
@ IN SOA test.com. root.localhost.(2006102001 28800  14400 3600000  86400 )

@ IN NS test.com.
38 IN PTR test.com

[root@localhost named]# nslookup
> www.test.com
Server:         222.196.70.38
Address:        222.196.70.38#53

Non-authoritative answer:
Name:   www.test.com.localdomain
Address: 61.139.8.100  #在查询不到记录的时候,我的机器有时会固定地给出这个地址,不知道为什么.
[root@localhost named]# nslookup
> www.test.com
Server:         222.196.70.38
Address:        222.196.70.38#53

** server can't find www.test.com: NXDOMAIN
> 222.196.70.38
Server:         222.196.70.38
Address:        222.196.70.38#53

** server can't find 38.70.196.222.in-addr.arpa.: NXDOMAIN

这个是系统日志:
May  6 20:00:17 localhost named[8287]: loading configuration from '/etc/named.conf'
May  6 20:00:17 localhost named[8287]: using default UDP/IPv4 port range: [1024,65535]
May  6 20:00:17 localhost named[8287]: using default UDP/IPv6 port range: [1024,65535]
May  6 20:00:17 localhost named[8287]: listening on IPv4 interface lo, 127.0.0.1#53
May  6 20:00:17 localhost named[8287]: listening on IPv4 interface eth0, 222.196.70.38#53
May  6 20:00:17 localhost named[8287]: command channel listening on 127.0.0.1#953
May  6 20:00:17 localhost named[8287]: command channel listening on ::1#953
May  6 20:00:17 localhost named[8287]: the working directory is not writable
May  6 20:00:17 localhost named[8287]: zone 0.0.127/IN: loaded serial 2006102001
May  6 20:00:17 localhost named[8287]: zone 70.196.222/IN: loaded serial 2006102001
May  6 20:00:17 localhost named[8287]: zone test.com/IN: loaded serial 2006102003
May  6 20:00:17 localhost named[8287]: zone localhost/IN: loaded serial 2006102001
May  6 20:00:17 localhost named[8287]: running

论坛徽章:
0
2 [报告]
发表于 2010-06-07 16:18 |只看该作者
你的问题估计现在已经解决了吧。

[root@localhost named]# cat named.test.com
$TTL 600
@ IN SOA  test.com.  root.test.com.(2006102003 28800 14400 72000 86400)
@ IN NS test.com.
IN A 222.196.70.38

首先这个记录是记录的test.com的ip地址是多少,而没有记录www.test.com,所以你需要再添加一条记录如下:
www  IN A 222.196.70.38
这样应该就可以了。

论坛徽章:
0
3 [报告]
发表于 2010-06-16 10:34 |只看该作者
你的问题估计现在已经解决了吧。

[root@localhost named]# cat named.test.com
$TTL 600
@ IN SOA  te ...
小小红帽 发表于 2010-06-07 16:18



    恩,问题已经解决了咯,仍然谢谢你!
是因为我的系统里面没有安装caching-server包,所以没有named的默认配置范例文件,然后我照网上写的,所以写出来的文件不规范。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP