免费注册 查看新帖 |

Chinaunix

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

[DNS] DNS解析 问题 请教 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-03-11 11:08 |只看该作者 |倒序浏览
各位 ,我在 linux下 配置DNS后使用nslookup测试
server 127.0.0.1后 可以正常解析
但选择server 192.168.13.1(本机DNS服务器地址)后查询就不可以 提示连接不到 配置文件和测试信息 如下,请 帮帮忙看看

named.conf:
options {
        listen-on port 53 { any; };
        //listen-on-v6 port 53 { ::1; };
        directory         "/var/named";
        dump-file         "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";

        allow-query     { any; };
        allow-query-cache { any; };
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
       };
};
view localhost_resolver {
        match-clients            { any; };
        match-destinations { any; };
        recursion yes;
        zone "." IN {
        type hint;
        file "named.ca";
};

zone "localdomain" IN {
        type master;
        file "localdomain.zone";
        allow-update { none; };
};

zone "localhost" IN {
        type master;
        file "localhost.zone";
        allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
        type master;
        file "named.local";
        allow-update { none; };
};

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 {
        type master;
        file "named.ip6.local";
        allow-update { none; };
};

zone "255.in-addr.arpa" IN {
        type master;
        file "named.broadcast";
        allow-update { none; };
};

zone "0.in-addr.arpa" IN {
        type master;
        file "named.zero";
        allow-update { none; };
};

zone "test.com" IN {
        type master;
        file "test.com.zone";
        allow-update { none; };
};

zone "13.168.192.in-addr.arpa" IN {
        type master;
        file "test.com.rev";
        allow-update { none; };
};

};



test.com.zone正向解析文件

$TTL        86400
@                IN SOA        dns1.test.com.      root.test.com. (
                                        42                ; serial (d. adams)
                                        3H                ; refresh
                                        15M                ; retry
                                        1W                ; expiry
                                        1D )                ; minimum

                IN NS                dns1.test.com.
                          IN NS                dns2.test.com.
                IN  MX   5  mail.test.com.
dns1             IN A                192.168.13.1
dns1             IN A                192.168.13.2
www                   IN CNAME         dns1.test.com.
ftp                        IN CNAME         dns2.test.com.
mail        IN CNAME  dns2.test.com.


test.com.rev反向解析文件
$TTL        86400
@       IN      SOA     dns1.test.com. root.test.com.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
        IN      NS      localhost.
1       IN      PTR     dns1.test.com.
1       IN      PTR     www.test.com.
2       IN      PTR     dns2.test.com.
2       IN      PTR     ftp.test.com.




测试信息

[root@test named]# nslookup
> server 127.0.0.1
Default server: 127.0.0.1
Address: 127.0.0.1#53
> www.test.com
Server:         127.0.0.1
Address:        127.0.0.1#53

www.test.com    canonical name = dns1.test.com.
Name:   dns1.test.com
Address: 192.168.13.1
Name:   dns1.test.com
Address: 192.168.13.2
> 192.168.13.1
Server:         127.0.0.1
Address:        127.0.0.1#53

1.13.168.192.in-addr.arpa       name = dns1.test.com.
1.13.168.192.in-addr.arpa       name = www.test.com.
> server 192.168.13.1
Default server: 192.168.13.1
Address: 192.168.13.1#53
> www.test.com
;; connection timed out; no servers could be reached
> 192.168.13.1
;; connection timed out; no servers could be reached
>

论坛徽章:
0
2 [报告]
发表于 2011-03-14 14:58 |只看该作者
顶一下

论坛徽章:
0
3 [报告]
发表于 2011-03-15 13:16 |只看该作者
IN NS                dns1.test.com.
                          IN NS                dns2.test.com.
                IN  MX   5  mail.test.com.
dns1             IN A                192.168.13.1
dns1             IN A                192.168.13.2

论坛徽章:
0
4 [报告]
发表于 2011-03-15 13:17 |只看该作者
dns2在哪里?本机ip是多少?netstat -tunl有监听所有地址?
还是换dig命令吧,别用nslookup了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP