- 追加された行はこの色です。
- 削除された行はこの色です。
- Cent_DNS へ行く。
#contents();
*** DNS (BIND) の導入 [#pd4e3253]
*** キャッシングサーバーの導入 [#x7ba139a]
yum -y install caching-nameserver
May 18 00:42:12 (yumex) Installed: caching-nameserver.noarch 7.3-3
*** DNS の基本設定 = ゾーン定義 (/etc/named.conf) [#i1c41a21]
- &ref(named.conf,center,named.conf);
// Default named.conf generated by install of bind-9.2.4-2
// アクセス制御リスト
acl localnet {
192.168.1.0/24;
127.0.0.1;
};
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
allow-query {localnet; }; // 問い合わせ元の制限
allow-transfer {localnet; }; // 転送先の制限
// プロバイダーのDNSを参照させる設定
forwarders {
210.130.232.1; //IIJ mio1
210.130.1.1; //IIJ4U
};
// recursion yes; //ローカルキャッシュの再帰参照を許可
};
// rndcで制御可能なホストを指定(localhostのみ可)
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
// rndc秘密鍵の読込みパスを指定
include "/etc/rndc.key";
// 内向きの DNS 設定
view "lan" {
match-clients {
localnet;
};
// ”ルート”のゾーン設定
zone "." IN {
type hint;
file "named.ca";
};
// ”正引き”ループバックのゾーン設定
zone "localhost" IN {
type master;
file "local_for";
};
// ”逆引き”ループバックのゾーン設定
zone "0.0.127.in-addr.arpa" IN {
type master;
file "local_rev";
};
// ”正引き”自宅内の hmuna ゾーン設定
zone "hmuna.com" IN {
type master;
file "hmuna.com_inside";
};
// ”正引き”自宅内の gochiharu ゾーン設定
zone "gochiharu.org" IN {
type master;
file "gochiharu.org_inside";
};
// ”逆引き”の自宅内のゾーン設定
zone "1.168.192.in-addr.arpa" IN {
type master;
file "1.168.192.in-addr.arpa";
};
};
// 外向きの DNSの設定 (今は使っていない)
view "wan" {
match-clients {
any;
};
recursion no; // 再帰検索の禁止
// ”正引き”の hmuna.com のゾーン設定
// zone "hmuna.com" IN {
// type master;
// file "hmuna.com_outside";
// allow-transfer { xxx.xxx.xxx.xxx; }; // セカンダリーDNSにのみ転送可能
// allow-query { any; }; // 問い合わせには全て応答する
// notify yes;
// };
// ”正引き”の gochiharu.org のゾーン設定
// zone "gochiharu.org" IN {
// type master;
// file "gochiharu.org_outside";
// allow-transfer { xxx.xxx.xxx.xxx; }; // セカンダリーDNSにのみ転送可能
// allow-query { any; }; // 問い合わせには全て応答する
// notify yes;
// };
};
// logging
logging {
channel default-log {
file "/var/log/named/named.log" versions 5 size 1m;
severity info;
print-time yes;
print-category yes;
};
category lame-servers { null; }; // 逆引きのエラーをログにとらない
category default { default-log; };
};
*** "ルートゾーン" ( /var/named/named.ca )の設定 [#zf90a238]
- &ref(named.ca);
*** "正引き”ループバックのゾーン" ( /var/named/local_for ) [#ma445653]
- &ref(local_for);
$TTL 1D
@ IN SOA localhost. server_admin.localhost. (
2006020501 ; serial
3H ; Refresh
1H ; Retry
1W ; Expire
1D ) ; Minimum
IN NS localhost.
IN A 127.0.0.1
*** "逆引き”ループバックのゾーン" ( /var/named/local_rev ) [#y695e843]
- &ref(local_rev);
$TTL 1D
@ IN SOA spirit.hmuna.com. server_admin.hmuna.com. (
2006020501 ; serial
3H ; Refresh
1H ; Retry
1W ; Expire
1D ) ; Minimum
IN NS spirit.hmuna.com.
1 IN PTR localhost.
*** "自宅内の正引きゾーン" ( /var/named/hmuna.com_inside ) [#ga1597c2]
- 2006-8-15 版 ( backup の追加と順番の整理 )-----> &ref(hmuna.com_inside_20060815);
$TTL 1D
@ IN SOA spirit.hmuna.com. server_admin.hmuna.com. (
2006081501 ; Serial
3H ; Refresh
1H ; Retry
1W ; Expire
1D ) ; Minimum
IN NS spirit.hmuna.com. ; name server
IN MX 10 mail.hmuna.com. ; primary mail server
@ IN A 192.168.1.22 ;
router IN A 192.168.1.1 ; SuperOPT G
wireless IN A 192.168.1.2 ; Linksys Wireless-G Access Point
landeboot IN A 192.168.1.5 ; Network Power controller
backup IN A 192.168.1.11 ; PC backup
muna-home-win IN A 192.168.1.14 ; PC workstation
charisma IN A 192.168.1.17 ; Linux development work station
spirit IN A 192.168.1.22 ; 2nd gen. server
wiki IN CNAME spirit ; wiki server
www IN CNAME spirit ; apache server
mail IN CNAME spirit ; postfix mail server
ldap IN CNAME spirit ; ldap server
*** "自宅内の逆引きゾーン" ( /var/named/1.168.192.in-addr.arpa ) [#zb30b5de]
- &ref(1.168.192.in-addr.arpa);
$TTL 1D
@ IN SOA spirit.hmuna.com. server_admin.hmuna.com. (
2006051301 ; Serial
3H ; Refresh
1H ; Retry
1W ; Expire
1D ) ; Minimum
IN NS spirit.hmuna.com.
1 IN PTR router.hmuna.com.
2 IN PTR wireless.hmuna.com.
5 IN PTR lamdeboot.hmuna.com.
14 IN PTR muna-home-win.hmuna.com.
17 IN PTR power.hmuna.com.
22 IN PTR spirit.hmuna.com.
22 IN PTR www.gochiharu.org.
- &color(red){上記設定だと、例えばメーラーが自動転送するときのホストネームが spirit.hmuna.com のケースと、www.gochiharu.org のケースが発生してしまうことがわかった。 とりあえず運用していない www.gochiharu.com を削除したが、本来は 名前ベースのバーチャルサーバー運用時の逆引きの設定をする必要があり、これは別途検討とする};
[root@spirit named]# cat 1.168.192.in-addr.arpa
$TTL 1D
@ IN SOA spirit.hmuna.com. server_admin.hmuna.com. (
2006062902 ; Serial
3H ; Refresh
1H ; Retry
1W ; Expire
1D ) ; Minimum
IN NS spirit.hmuna.com.
1 IN PTR router.hmuna.com.
2 IN PTR wireless.hmuna.com.
5 IN PTR landeboot.hmuna.com.
14 IN PTR muna-home-win.hmuna.com.
17 IN PTR power.hmuna.com.
22 IN PTR spirit.hmuna.com.
- 2006-8-15 更新
-- 2006-8-15 版 ( backup の追加 )-----> &ref(1.168.192.in-addr.arpa_20060815);
$TTL 1D
@ IN SOA spirit.hmuna.com. server_admin.hmuna.com. (
2006081501 ; Serial
3H ; Refresh
1H ; Retry
1W ; Expire
1D ) ; Minimum
IN NS spirit.hmuna.com.
1 IN PTR router.hmuna.com.
2 IN PTR wireless.hmuna.com.
5 IN PTR landeboot.hmuna.com.
11 IN PTR backup.hmuna.com.
14 IN PTR muna-home-win.hmuna.com.
17 IN PTR charisma.hmuna.com.
22 IN PTR spirit.hmuna.com.
*** "外向きの正引きゾーン" ( /var/named/hmuna.com_outside ) [#u7bcf725]
- 現在利用している IIJ Mio では 外向きの DNS の公開を許していないので実際には利用されていない。
- &ref(hmuna.com_outside);
$TTL 1D
@ IN SOA spirit.hmuna.com. root.spirit.hmuna.com. (
2006051301 ; Serial
3H ; Refresh
15M ; Retry
1W ; Expire
1D ) ; Minimum
IN NS spirit.hmuna.com. ; name server
IN NS spirit.hmuna.com. ; name server
IN MX 10 spirit.hmuna.com. ; primary mail server
@ IN A 210.138.152.229
spirit IN A 210.138.152.229 ; 2nd gen. server
wiki IN CNAME spirit ; wiki server
www IN CNAME spirit ; apache server
mail IN CNAME spirit ; postfix mail server
ldap IN CNAME spirit ; ldap server
landeboot IN CNAME spirit ; network power controll
www.gochiharu.org IN CNAME spirit.hmuna.com ; Virtual domain "gochiharu"
*** BIND の起動 [#c7f3447f]
[root@spirit ~]# service named restart
named を停止中: [ OK ]
named を起動中: [ OK ]
*** 参考 URL [#r8e66156]
- [[パソコンおやじ:http://www.aconus.com/~oyaji/dns/bind_linux_out.htm]]
- [[はじめての自宅サーバー構築:http://kajuhome.com/bind.shtml]]