免费注册 查看新帖 |

Chinaunix

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

[DNS] dns配置 全过程 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-06-04 18:14 |只看该作者 |倒序浏览
一下是小弟的配置信息:
[root@test-pc named]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:55:0F:C0  
          inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe55:fc0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11981 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4394 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:991232 (968.0 KiB)  TX bytes:510647 (498.6 KiB)
          Interrupt:193 Base address:0x2000

[root@test-pc named]# cat /etc/named.conf
//
// named.conf for Red Hat caching-nameserver
//
options {
        directory "/var/named";
        dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
         // query-source address * port 53;
};
//
// a caching only nameserver config
//
controls {
        inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
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 "1.168.192.in-addr.arpa" IN {
      type master;
        file "test.com.rev";
        allow-update { none; };
};

include "/etc/rndc.key";

[root@test-pc named]# cat /var/named/test.com.zone
$TTL    86400
@ IN SOA  test.com.   root.test.com. (
                      42                ; serial (d. adams)
                      3H                ; refresh
                      15M               ; retry
                      1W                ; expiry
                      1D                ; minimum
                                     }


@         IN       NS    ns.test.com.
ns        IN       A     192.168.1.10

[root@test-pc named]# cat /var/named/test.com.rev
$TTL    86400
@       IN      SOA    test.com.  root.com.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
            


@     IN      NS      ns.test.com.
10    IN      PTR     ns.test.com.

[root@test-pc named]# host test.com                             调试半天竟然出现这样的结果,呵呵 小弟初学,不知道是哪里出现了配置错误。
Host test.com not found: 2(SERVFAIL)

[root@test-pc named]# host 192.168.1.10

Host 10.1.168.192.in-addr.arpa not found: 2(SERVFAIL)

[root@test-pc named]# netstat -ntl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State      
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      
tcp        0      0 192.168.1.10:53             0.0.0.0:*                   LISTEN      
tcp        0      0 127.0.0.1:53                0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN      
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      
tcp        0      0 127.0.0.1:953               0.0.0.0:*                   LISTEN      
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:670                 0.0.0.0:*                   LISTEN      
tcp        0      0 :::22                       :::*                        LISTEN

论坛徽章:
0
2 [报告]
发表于 2010-06-06 01:45 |只看该作者
1、参考斑斑的帖子--善用日志排错
http://bbs.chinaunix.net/viewthread.php?tid=1637987
2、使用named-checkconf以及named-checkzone检查配置文件是否有语法错误
3、建议使用dig,可以给出更多信息

论坛徽章:
0
3 [报告]
发表于 2010-06-07 10:22 |只看该作者
先看日志是个好习惯

论坛徽章:
0
4 [报告]
发表于 2010-07-23 15:00 |只看该作者
Host test.com not found: 2(SERVFAIL),一般是端口问题,打开对应端口就可以了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP