DNS - BINDのインストール・設定方法。
対象:Linux Fedora, RedHat
nslookup example.jp Server: 192.168.1.5 Address: 192.168.1.5#53 Name: example.jp Address: 123.213.7.11
まず、named.confの下の方に以下を追加。 vi /etc/named.conf options { directory "/var/named"; pid-file "/var/run/named/named.pid"; //recursion yes; //max-ncache-ttl 300; //max-cache-ttl 3600; //lame-ttl 600; }; zone "example.co.jp" IN { type master; file "example.co.jp.db"; allow-update { none; }; }; zone "example.jp" IN { type master; file "example.jp.db"; allow-update { none; }; }; zone "11.168.192.in-addr.arpa" IN { type master; file "11.168.192.in-addr.arpa.db"; allow-update { none; }; }; zone "123.111.219.in-addr.arpa" IN { type master; file "123.111.219.in-addr.arpa.db"; allow-update { none; }; }; 次に、各正引き、逆引き設定ファイルを作る。 vi /var/named/example.co.jp.db $ORIGIN example.co.jp. $TTL 86400 @ IN SOA www.example.co.jp. root.example.co.jp.( 2005010802 ;Serial 3600 ;Refresh 1800 ;Retry 604800 ;Expire 86400 ;Minimum TTL ) IN NS www.example.co.jp. IN NS dns01.test.or.jp. IN NS dns02.test.or.jp. IN A 219.111.123.01 IN MX 10 www.example.co.jp. www IN A 219.111.123.01 IN MX 10 www test IN CNAME www vi /var/named/example.jp.db $ORIGIN example.jp. $TTL 86400 @ IN SOA www.example.co.jp. root.example.co.jp.( 2005010802 ;Serial 3600 ;Refresh 1800 ;Retry 604800 ;Expire 86400 ;Minimum TTL ) IN NS www.example.co.jp. IN NS dns01.test.or.jp. IN NS dns02.test.or.jp. IN A 219.111.123.01 IN MX 10 www.example.co.jp. www IN A 219.111.123.01 IN MX 10 www test IN CNAME www vi /var/named/123.111.219.in-addr.arpa.db $ORIGIN 123.111.219.in-addr.arpa. $TTL 86400 @ IN SOA www.example.co.jp. root.example.co.jp.( 2005010802 ;Serial 3600 ;Refresh 1800 ;Retry 604800 ;Expire 86400 ;Minimum TTL ) IN NS www.example.co.jp. IN NS dns01.test.or.jp. IN NS dns02.test.or.jp. 91 IN PTR www.example.co.jp. vi /var/named/11.168.192.in-addr.arpa.db $ORIGIN 11.168.192.in-addr.arpa. $TTL 86400 @ IN SOA www.example.co.jp. root.example.co.jp.( 2005010802 ;Serial 3600 ;Refresh 3600 ;Retry 604800 ;Expire 86400 ;Minimum TTL ) IN NS www.example.co.jp. IN NS dns01.example.or.jp. IN NS dns02.example.or.jp. 2 IN PTR www.example.co.jp.