리눅스1

vi /etc/named.rfc1912.zones 수정

zone "localhost.localdomain" IN {
        type master;
        file "named.localhost";
        allow-update { none; };
};

zone "localhost" IN {
        type master;
        file "named.localhost";
        allow-update { none; };
};

zone "1.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.loopback";
        allow-update { none; };
};

zone "1.0.0.127.in-addr.arpa" IN {
        type master;
        file "named.loopback";
        allow-update { none; };
};

zone "0.in-addr.arpa" IN {
        type master;
        file "named.empty";
        allow-update { none; };
};

zone "kgitbank.com" IN {
        type master;
        file "kgitbank.zone";
        also-notify { 192.168.1.129; }; 
        //추가, slave쪽에서 영역 파일 전송을 다시 요청할 때 허용할 곳의 IP 주소
        // any 셋팅 허용하면 안됨. 어디서든 영역파일을 전송을 허용
        allow-transfer { 192.168.1.129; }; 
        //추가, 영역 전송을 허용할 곳의 IP 주소
        // any 셋팅 허용하면 안됨. 어디서든 영역파일을 전송을 허용
};

zone "1.168.192.in-addr.arpa" IN {
        type master;
        file "kgitbank.rev";
        also-notify { 192.168.1.129; }; 
        //추가, slave쪽에서 영역 파일 전송을 다시 요청할 때 허용할 곳의 IP 주소
        // any 셋팅 허용하면 안됨. 어디서든 영역파일을 전송을 허용
        allow-transfer { 192.168.1.129; }; 
        //추가, 영역 전송을 허용할 곳의 IP 주소
        // any 셋팅 허용하면 안됨. 어디서든 영역파일을 전송을 허용
};

vi kgitbank.zone 편집

Untitled

slave 서버를 위해서 추가로 작업

vi kgitbank.rev 편집

Untitled

여기도 같이 추가 작업

변경사항 적용

Untitled

리눅스2

bind 패키지 설치

Untitled

설치 확인

Untitled

vi /etc/named.conf 편집

options {
        listen-on port 53 { any; };
        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";
        recursing-file  "/var/named/data/named.recursing";
        secroots-file   "/var/named/data/named.secroots";
        allow-query     { any; };
        recursion no;
        dnssec-enable yes;
        dnssec-validation yes;
        bindkeys-file "/etc/named.root.key";
        managed-keys-directory "/var/named/dynamic";
        pid-file "/run/named/named.pid";
        session-keyfile "/run/named/session.key";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
        type hint;
        file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

vi /etc/named.rfc1912.zones 편집

zone "localhost.localdomain" IN {
        type master;
        file "named.localhost";
        allow-update { none; };
};

zone "localhost" IN {
        type master;
        file "named.localhost";
        allow-update { none; };
};

zone "1.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.loopback";
        allow-update { none; };
};

zone "1.0.0.127.in-addr.arpa" IN {
        type master;
        file "named.loopback";
        allow-update { none; };
};

zone "0.in-addr.arpa" IN {
        type master;
        file "named.empty";
        allow-update { none; };
};

zone "kgitbank.com" IN {
        type slave;
        file "slaves/kgitbank.zone.slave";
        // 내가 전송받은 영역 파일을 여기에 저장하겠다.
        notify yes;
        // 변경사항이 있으면 자동으로 로드하겠다.
        masters { 192.168.1.128; };
        // 마스터 서버가 어디인지 정확하게 명시
        masterfile-format text;
        // 마스터에 전송되는 파일이 요즘에는 binary 형식으로 전송되는데, 텍스트로 바꾼 것
};

zone "1.168.192.in-addr.arpa" IN {
        type slave;
        file "slaves/kgitbank.rev.slave";
        notify yes;
        masters { 192.168.1.128; };
        masterfile-format text;
        // 마스터에 전송되는 파일이 요즘에는 binary 형식으로 전송되는데, 텍스트로 바꾼 것
};

방화벽 설정

Untitled

iptables 설정 추가

Untitled

dns slave 파일 확인

Untitled

클라이언트

DNS IP 추가

Untitled

IP 통신 확인 완료

Untitled