chenlb 发表于 2013-1-16 00:50:07

dns server on centos

想到局域网上建一个dns服务器,昨天晚上搞了好久都不成,包括今天也发了好多时间也不能通过.最后找到
秋水小筑之Blog
http://blog.chinaunix.net/u/5302/showart_238337.html
的博客, 帮了大忙,网上的很多文章都试过了都没有很好的结果.

我安装的centos是单CD的服务版本.安装后已经有bind了

1.配置文件在/etc/named.conf
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee;">//
// 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 "chenlb.com" IN {
    type master;
    file "chenlb.com.zone";
    allow-query { any; };
    allow-transfer { any; };
    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; };
};

include "/etc/rndc.key";
页: [1]
查看完整版本: dns server on centos