7,164
edits
(→内部 DNS) |
(→内部 DNS) |
||
Line 273: | Line 273: | ||
/usr/local/etc/bind/templates/zone.tmpl | /usr/local/etc/bind/templates/zone.tmpl | ||
<syntaxhighlight lang="text" enclose="div"> | <syntaxhighlight lang="text" enclose="div"> | ||
; | |||
; BIND data file for Split DNS | |||
; | |||
@ 604800 IN SOA localhost. root.localhost. ( | |||
2 ; Serial | |||
604800 ; Refresh | |||
86400 ; Retry | |||
2419200 ; Expire | |||
604800 ) ; Negative Cache TTL | |||
; | |||
@ 604800 IN NS localhost. | |||
@ 604800 IN A $localipv4 | |||
@ 604800 IN MX 10 @ | |||
</syntaxhighlight> | </syntaxhighlight> | ||
/usr/local/etc/bind/templates/zone.tmpl | /usr/local/etc/bind/templates/zone.tmpl | ||
<syntaxhighlight lang="text" enclose="div"> | <syntaxhighlight lang="text" enclose="div"> | ||
; | |||
; BIND data file for Split DNS | |||
; | |||
@ 604800 IN SOA localhost. root.localhost. ( | |||
2 ; Serial | |||
604800 ; Refresh | |||
86400 ; Retry | |||
2419200 ; Expire | |||
604800 ) ; Negative Cache TTL | |||
; | |||
@ 604800 IN NS localhost. | |||
@ 604800 IN PTR $fqdn. | |||
</syntaxhighlight> | </syntaxhighlight> | ||
/usr/local/etc/bind/templates/conf.tmpl | /usr/local/etc/bind/templates/conf.tmpl | ||
<syntaxhighlight lang="text" enclose="div"> | <syntaxhighlight lang="text" enclose="div"> | ||
zone "$fqdn" { | |||
type master; | |||
file "/etc/bind/db.myzone"; | |||
}; | |||
zone "$arpa" { | |||
type master; | |||
file "/etc/bind/db.myarpa"; | |||
}; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
/etc/bind/named.conf.local に以下を追加する | /etc/bind/named.conf.local に以下を追加する | ||
<syntaxhighlight lang="text" enclose="div"> | <syntaxhighlight lang="text" enclose="div"> | ||
include "/etc/bind/myzone.conf"; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
/etc/bind/named.conf.options の forwarders を EC2 の内部 DNS サーバに設定 | /etc/bind/named.conf.options の forwarders を EC2 の内部 DNS サーバに設定 | ||
<syntaxhighlight lang="text" enclose="div"> | <syntaxhighlight lang="text" enclose="div"> | ||
forwarders { | |||
172.16.0.23; | |||
}; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
/etc/bind/named.conf.options の listen address 制限しておく | /etc/bind/named.conf.options の listen address 制限しておく | ||
<syntaxhighlight lang="text" enclose="div"> | <syntaxhighlight lang="text" enclose="div"> | ||
// listen-on-v6 { any; }; | |||
listen-on { 127.0.0.1; }; | |||
listen-on-v6 { ::1; }; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
起動スクリプトとしてリンク | 起動スクリプトとしてリンク | ||
<syntaxhighlight lang="bash" enclose="div"> | <syntaxhighlight lang="bash" enclose="div"> |