手当たり次第に書くんだ

飽きっぽいのは本能

CentOS 5 BIND 内部用 DNS サーバー構築

Overview

CentOS 5 における DNS サーバーの構築手順です。

インストール

[root@centos-5 ~]# yum -y install bind bind-chroot caching-nameserver

/var/named/chroot/etc/named.conf

[root@centos-5 ~]# cp -a /var/named/chroot/etc/named.caching-nameserver.conf /var/named/chroot/etc/named.conf
[root@centos-5 ~]# vim /var/named/chroot/etc/named.conf
options {
    listen-on port 53 { 127.0.0.1; 10.0.0.53; };
    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 { 127.0.0.1; 10.0.0.0/24; };
    forwarders { 10.0.0.1; };
    version "";
};
logging {
    channel default_debug {
        file "data/named.run";
        severity dynamic;
    };
};
view localhost_resolver {
    match-clients { 127.0.0.1; };
    match-destinations { 127.0.0.1; };
    recursion yes;
    include "/etc/named.rfc1912.zones";
    include "/etc/named.si1230.com.zones";
};
view internal {
    match-clients { 10.0.0.0/24; };
    match-destinations { 10.0.0.53; };
    recursion yes;
    include "/etc/named.rfc1912.zones";
    include "/etc/named.si1230.com.zones";
};

/var/named/chroot/etc/named.si1230.com.zones

[root@centos-5 ~]# vim /var/named/chroot/etc/named.si1230.com.zones
zone "si1230.com" IN {
    type master;
    file "si1230.com.zone";
    allow-update { none; };
    allow-transfer { none; };
    notify no;
};
zone "0.0.10.in-addr.arpa" {
    type master;
    file "0.0.10.in-addr.arpa";
    allow-update { none; };
    allow-transfer { none; };
    notify no;
};
[root@centos-5 ~]# chgrp named /var/named/chroot/etc/named.si1230.com.zones

/var/named/chroot/var/named/si1230.com.zone

[root@centos-5 ~]# vim /var/named/chroot/var/named/si1230.com.zone
$TTL 172800
@ IN SOA dns.si1230.com. root.si1230.com. (
    2012021501
    3600
    300
    360000
    86400
)
@ IN NS dns.si1230.com.
@ IN MX 10 mail.si1230.com.
mail IN A 10.0.0.25
dns IN A 10.0.0.53
www IN A 10.0.0.80
[root@centos-5 ~]# chgrp named /var/named/chroot/var/named/si1230.com.zone

/var/named/chroot/var/named/0.0.10.in-addr.arpa

[root@centos-5 ~]# vim /var/named/chroot/var/named/0.0.10.in-addr.arpa
$TTL 172800
@ IN SOA dns.si1230.com. root.si1230.com. (
    2012021501
    3600
    300
    360000
    86400
)
@ IN NS dns.si1230.com.
25 IN PTR mail.si1230.com.
53 IN PTR dns.si1230.com.
80 IN PTR www.si1230.com.
[root@centos-5 ~]# chgrp named /var/named/chroot/var/named/0.0.10.in-addr.arpa

サービス起動設定

[root@centos-5 ~]# service named start
[root@centos-5 ~]# chkconfig named on && chkconfig named --list
CentOS 5 BIND 内部用 DNS サーバー構築

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)

トップへ戻る