sleepingbird.net Home since May.11 2003
Copyright sleepingbird, 1993- All rights reserved.
Linux Server

TOP > Linux Server > DNS (named) > hosts.conf / named.conf

hosts.conf / named.conf

 named を使って DNS を構築する。

 /etc/hosts.conf を確認する。
 名前解決は、/etc/hosts を参照し、次にネームサーバーを利用する設定にしておく。

# vi /etc/host.conf
order hosts,bind
multi on
 次に /etc/named.conf を修正する。
 ここでは、設定ファイルの場所と、それぞれのファイル名を指定する。
 設定ファイルは /var/named ディレクトリ下に置く。
 forwarders に接続 ISP のネームサーバーを設定し、負荷を軽減する。(実際の設定では ***.***.***.*** には ISP の DNS IP アドレスを書き込む。)
 ファイル名はそれぞれ次のとおりとする。
  • ルートネームサーバー情報ファイル
    named.ca
  • ループバック順引きファイル
    localhost.zone
  • ループバック逆引きファイル
    named.local
  • 自ネットワーク順引きファイル
    qcp.zone
  • 自ネットワーク逆引きファイル
    qcp.rev
# vi /etc/named.conf
// generated by named-bootconf.pl
options {
               directory "/var/named";
/*
* 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;
                forward first;
                forwarders {
                                ***.***.***.***;
                                ***.***.***.***;
                                ***.***.***.***;
                };
};

// 
// a caching only nameserver config
// 
zone "." IN {
                type hint;
                file "named.ca";
};

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 "qcp.jp" IN {
                type master;
                file "qcp.zone";
                allow-update { none; };
};

zone "1.99.10.in-addr.arpa" IN {
                type master;
                notify no;
                file "qcp.rev";
                allow-update { none; };
};