// // named.caching-nameserver.conf // options { // listen-on port 53 { 127.0.0.1; }; // listen-on-v6 port 53 { ::1; }; directory "/var/named"; dump-file "/var/named/data/cache_dump.db"; statistics-file "/var/named/data/named_stats.txt"; memstatistics-file "/var/named/data/named\_mem\_stats.txt"; // Those options should be used carefully because they disable port // randomization // query-source port 53; // query-source-v6 port 53; allow-query { localhost; localnets; }; allow-recursion { 127.0.0.1; 192.168.1.0/24; }; allow-transfer{ 127.0.0.1; 192.168.1.0/24; }; forwarders { 192.168.1.1; }; }; logging { channel default_debug { file "data/named.run"; severity dynamic; }; }; view "internal" { match-clients { localnets; }; match-destinations { localnets; }; recursion yes; include "/etc/named.rfc1912.zones"; zone "intranet.local" IN { type master; file "intranet.local.zone"; }; };
intranet.local ゾーンの正引きファイルを作成
1 2
# cd /var/named/chroot/var/named # vi intranet.local.zone
1 2 3 4 5 6 7 8 9 10 11
$TTL 86400 @ IN SOA intranet.local. root.intranet.local. ( 2008073002 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum IN NS intranet.local. @ IN A 192.168.1.2 host1 IN A 192.168.1.3 host2 IN A 192.168.1.4
起動およびデーモン設定
named サービスを起動。 ランレベル 2〜5 で named を走らせる。
# service named start # chkconfig –level=2345 named on
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 53 -j ACCEPT -A RH-Firewall-1-INPUT -m state –state NEW -m udp -p udp –dport 53 -j ACCEPT