CentOS DNS BIND

陈钰铠 发布于 2013/06/12 08:52
阅读 2K+
收藏 0
刚开始学安装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
>
加载中
0
王瑞平
王瑞平
没有设置A记录
0
OscerSong
OscerSong
not find !
返回顶部
顶部