独自ドメインを取得し外向けのDNSサーバを構築する場合のBINDの設定
独自ドメイン名はexample.comとし、内部向けのキャッシュサーバとしても運用する
acl localnet {
192.168.0.0/24;
127.0.0.1;
};
options {
directory "/var/named";
allow-recursion { localnet; };
allow-transfer { ***.***.***.***; };
allow-query { localnet; };
version "hogehoge";
};
"type hint"
zone "." IN {
type hint;
file "named.ca";
};
zone "localhost" IN {
type master;
file "local.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "local.rev";
allow-update { none; };
};
zone "example.com" IN {
type master;
file "example.zone";
allow-query { any; };
};
zone "***.***.***.in-addr.arpa" IN {
type master;
file "example.rev";
allow-query { any; };
};
192.168.0.0/24; 127.0.0.1; };
allow-query { localnet; };
allow-transfer { ***.***.***.***; };
recursion ・・・・ キャッシュサーバの利用を限定するversion "hogehoge";
type hint; file "named.ca"; };
type master;
file "example.zone";
allow-query { any; };
};
zone "***.***.***.in-addr.arpa" IN {
type master;
file "example.rev";
allow-query { any; };
};
type master;
file "local.zone";
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "local.rev";
};
/var/named/example.zone
@ IN SOA hoge1.example.com. root.example.com. (
2003081501 ; serial
3600 ; refresh
900 ; retry
604800 ; expire
86400 ; minimum
)
IN NS hoge1.example.com
IN MX 10 mail.example.com
hoge1 IN A 111.111.111.1
mail IN A 111.111.111.1
www IN A 111.111.111.2
ftp IN CNAME www
/var/named/example.rev
@ IN SOA hoge1.example.com. root.example.com. (
2003081501 ; serial
3600 ; refresh
900 ; retry
604800 ; expire
3600 ; minimum
)
IN NS hoge1.example.com.
1 IN PTR hoge1.example.com.
2 IN PTR www.example.com.
/var/named/local.zone
@ IN SOA localhost. root.localhost. (
2003081501 ; serial
28800 ; refresh
14400 ; retry
604800 ; expire
86400 ; minimum
)
IN NS localhost.
IN A 127.0.0.1
/var/named/local.rev
@ IN SOA localhost. root.localhost. (
2003081501 ; serial
28800 ; refresh
14400 ; retry
604800 ; expire
86400 ; minimum
)
IN NS localhost.
1 IN PTR localhost.
基本的には内部DNSサーバの確認手順と同様
ただし、ネームサーバの指定は当然外部のサーバにしておく事(自分のプロバイダ等)