bind (named)の 運用で キャッシュ とか マスター 、スレーブ とか 有るよ うですが、今回のものは キャッシュ と マスター 兼用として 扱うものとします。ついでにいうと 接続毎 IP-Address が変 わり 上位のサーバーから 委任されていないものであれば、キャ シュサーバーの設定出良いはずですがまあ練習を兼ねて 作成 してみます。参考の場所として 以下のものが有るようです。
http://www.isc.org/index.pl?/sw/bind/view/?release=9.2.6-P2
The following sample configuration is appropriate for a caching-only name server for use by clients internal to a corporation. All queries from outside clients are refused using the allow-query option. Alternatively, the same effect could be achieved using suitable firewall rules.// Two corporate subnets we wish to allow queries from. acl corpnets { 192.168.4.0/24; 192.168.7.0/24; }; options { directory "/etc/namedb"; // Working directory allow-query { corpnets; }; }; // Provide a reverse mapping for the loopback address 127.0.0.1 zone "0.0.127.in-addr.arpa" { type master; file "localhost.rev"; notify no; };An Authoritative-only Name Server This sample configuration is for an authoritative-only server that is the master server for "example.com" and a slave for the subdomain "eng.example.com".options { directory "/etc/namedb"; // Working directory allow-query-cache { none; }; // Do not allow access to cache allow-query { any; }; // This is the default recursion no; // Do not provide recursive service }; // Provide a reverse mapping for the loopback address 127.0.0.1 zone "0.0.127.in-addr.arpa" { type master; file "localhost.rev"; notify no; }; // We are the master server for example.com zone "example.com" { type master; file "example.com.db"; // IP addresses of slave servers allowed to transfer example.com allow-transfer { 192.168.4.14; 192.168.5.53; }; }; // We are a slave server for eng.example.com zone "eng.example.com" { type slave; file "eng.example.com.bk"; // IP address of eng.example.com master server masters { 192.168.4.12; }; };
では見てみましょう
acl nyansblx {
192.168.0.0/24;
127.0.0.1;
};
options {
directory "/var/named";
pid-file "/var/run/named/named.pid";
recursion yes;
allow-recursion {
nyansblx ;
};
allow-query {
nyansblx ;
};
allow-transfer {
none;
};
forward first ;
forwarders {
192.168.0.1;
};
};
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};
zone "." {
type hint;
file "root.hints";
};
zone "localhost" {
type master;
file "localhost.zone";
};
zone "0.0.127.in-addr.arpa" {
type master;
file "localhost.rev";
};
zone "bcnet.ne.jp" {
type master;
file "bcnet.hosts";
};
zone "0.168.192.in-addr.arpa" {
type master;
file "bcnet.hosts.rev";
};
include "/etc/rndc.key";
まあこういうものです、 正解という理由ではありません。参考までに
にゃんたろう 拝!
2007年 9月13日 (木) 22:48:05 JST 作成