免费注册 查看新帖 |

Chinaunix

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

[网络配置] CentOS dns bind [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-06-12 08:48 |只看该作者 |倒序浏览
本帖最后由 green0sky 于 2013-06-12 08:51 编辑

刚开始学安装dns 出现很多问题,一头雾水,请大家指点一下,完全不懂原理,照搬教程的,但是配置不成功。

named-checkzone 192.168.1.in-addr.arpa /var/named/rev.192.168.1
zone 192.168.1.in-addr.arpa/IN: NS 'ap.cts.net.192.168.1.in-addr.arpa' has no address records (A or AAAA)
zone 192.168.1.in-addr.arpa/IN: not loaded due to errors.
[root@ap etc]# cd /var/named
[root@ap named]# vim rev.192.168.1
[root@ap named]# vim cts.net
[root@ap named]# named-checkzone 192.168.1.in-addr.arpa /var/named/rev.192.168.1
zone 192.168.1.in-addr.arpa/IN: NS 'ap.cts.net.192.168.1.in-addr.arpa' has no address records (A or AAAA)
zone 192.168.1.in-addr.arpa/IN: not loaded due to errors.

service named start
启动 named:
Error in named configuration:
zone localhost.localdomain/IN: loading from master file named.localhost failed: file not found
zone localhost.localdomain/IN: not loaded due to errors.
_default/localhost.localdomain/IN: file not found
zone localhost/IN: loading from master file named.localhost failed: file not found
zone localhost/IN: not loaded due to errors.
_default/localhost/IN: file not found
zone 1.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: loading from master file named.loopback failed: file not found
zone 1.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: not loaded due to errors.
_default/1.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: file not found
zone 1.0.0.127.in-addr.arpa/IN: loading from master file named.loopback failed: file not found
zone 1.0.0.127.in-addr.arpa/IN: not loaded due to errors.
_default/1.0.0.127.in-addr.arpa/IN: file not found
zone 0.in-addr.arpa/IN: loading from master file named.empty failed: file not found
zone 0.in-addr.arpa/IN: not loaded due to errors.
_default/0.in-addr.arpa/IN: file not found
zone cts.net/IN: loaded serial 42
zone 1.168.192.in-addr.arpa/IN: has 0 SOA records
zone 1.168.192.in-addr.arpa/IN: has no NS records
zone 1.168.192.in-addr.arpa/IN: not loaded due to errors.
_default/1.168.192.in-addr.arpa/IN: bad zone
                                                           [失败]


cat cts.net
$TTL        86400
@        IN        SOA        ap.cts.net.        root.cts.net. (
                        42                ; serial (d. adams)
                        3H                ; refresh
                        15M                ; retry
                        1W                ; expiry
                        1D )                ; minimum

@        IN        NS        ap.cts.net.
ap        IN        A        192.168.1.2

cat rev.192.168.1
$TTL        86400
@        IN        SOA        ap.cts.net        root.cts.net. (
                        190 ; Serial
                        28800                ; Refresh
                        14400                ; Retry
                        3600000                ; Expiry
                        86400 )                ; Minimum

@        IN        NS        ap.cts.net
3        IN        PTR        ap.cts.net

cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

cat /etc/resolv.conf
nameserver 202.96.134.33
nameserver 192.168.1.2


cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@ap named]# cat /etc/resolv.conf
nameserver 202.96.134.33
nameserver 192.168.1.2

cat named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named( DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

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";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        allow-query     { any; };
        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;
        dnssec-lookaside auto;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";

        managed-keys-directory "/var/named/dynamic";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
        type hint;
        file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";


[root@ap etc]# cat /etc/named.rfc1912.zones
// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
// and http://www.ietf.org/internet-dra ... -local-zones-02.txt
// (c)2007 R W Franks
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

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

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


[root@ap named]# cd /var/named/chroot/var/named
[root@ap named]# ls
[root@ap named]# (目录为空?)



[root@ap named]# hostname
ap.cts.net
[root@ap named]# ping hostname
ping: unknown host hostname
[root@ap named]# nslookup
> ap.cts.net
Server:                202.96.134.33
Address:        202.96.134.33#53

** server can't find ap.cts.net: NXDOMAIN
>

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
2 [报告]
发表于 2013-06-12 20:46 |只看该作者

论坛徽章:
0
3 [报告]
发表于 2013-07-26 19:19 |只看该作者
thanks, dude.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP