1. 설치 방법
yum install bind bind-utils caching-nameserver
2. 환경 설정 * 주의 : 환경설정파일의 소유자는 root, 소유그룹이 named이여야 함
* 소유권변경방법: chown root:named 파일명
1) vi /etc/named.caching-nameserver.conf 편집
options { listen-on port 53 { 112.171.147.41; }; (--------1차 네임서버 ip) // 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 { any; }; allow-query-cache { localhost; }; }; logging { channel default_debug { file "data/named.run"; severity dynamic; }; }; view localhost_resolver { match-clients { localhost; }; match-destinations { localhost; }; recursion yes; include "/etc/named.rfc1912.zones"; }; |
2) vi /etc/named.rfc1912.zones 편집
zone "." IN { type hint; file "named.ca"; }; zone "localdomain" IN { type master; file "localdomain.zone"; allow-update { none; }; }; zone "localhost" IN { type master; file "localhost.zone"; allow-update { none; }; }; zone "0.0.127.in-addr.arpa" IN { type master; file "named.local"; allow-update { none; }; }; zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN { type master; file "named.ip6.local"; allow-update { none; }; }; zone "255.in-addr.arpa" IN { type master; file "named.broadcast"; allow-update { none; }; }; zone "0.in-addr.arpa" IN { type master; file "named.zero"; allow-update { none; }; }; zone "paeksang.com" IN { type slave; file "paeksang.com.zone"; masters { 112.171.147.40; }; }; |
rndc reload 도메인으로 리로드후 /var/named/chroot/var/named 도메인 존파일 생성확인
/var/log/message 확인해서 reroad되는지 확인
네임서버 설정확인 /var/named/chroot/var/ 의 권한을 named.named 로 변경해줘야함(퍼미션에러시)
more /etc/rndc.key 확인해서 키파일을 2차네임서버와 동일하게 설정해줘야함
(2차네임서버에서 vi /etc/rndc.key로 수정)