Linux Server - DNS 실습 (4 / 6) : Master/Slave Name Server 생성

● master - slave name server 생성 (allow-update/notify)

▶ master ns / slave ns 가 동기화 되어있다면 master의 zone파일 변경 내용이 slave에 자동으로 동기화 된다.
▶ allow-update로 묶여진 경우 - 초기 zone파일의 생성시 동기화 되거나, slave의 zone 파일이 삭제된 경우에만 동기화 된다.
▶ notify로 묶여진 경우 - Serial Number가 증감하면 그걸 탐지하여 자동으로 master의 정보를 동기화한다.
① slave zone파일의 동기화 확인 (allow-update)

Master Server(적용 전)
- named.conf -

[root@dns-localhost ~]# cat /etc/named.conf
options {
directory "/var/named";
};
zone "." {
type hint;
file "named.ca";
};
zone "ast008.org" {
type master;
file "ast008.zone";
notify yes;
allow-update{ 192.168.10.239; };
};
zone "ast008-2.org" {
type master;
file "ast008-2.zone";
};

- ast008.zone -


[root@dns-localhost ~]# cat /var/named/ast008.zone
$TTL    86400
@   IN   SOA  ns.ast008.org.   root.ns.ast008.org. (
                                   1997022722   ; Serial
                                   00001        ; Refresh
                                   14400        ; Retry
                                   3600000      ; Expire
                                   86400 )      ; Minimum
; Name Server
   IN   NS      ns.ast008.org.
; Mail Exchange
   IN   MX      10      mail.ast008.org.
; Host address
         IN     A   192.168.10.237
ns       IN     A   192.168.10.237
mail     IN     A   192.168.10.240
;
www      IN     CNAME  ns

Slave Server (적용 전)

- 아직은 없는 ast008.zone 파일 - 

[root@su2-localhost ~]# ll /var/named
합계 80
drwxrwxr-x 3 named named 4096  3월 20 10:03 chroot
drwxrwxr-x 2 named named 4096 11월 19  2009 data
-rwxrwxr-x 1 named named  198 11월 19  2009 localdomain.zone
-rwxrwxr-x 1 named named  195 11월 19  2009 localhost.zone
-rwxrwxr-x 1 named named  427 11월 19  2009 named.broadcast
-rwxrwxr-x 1 named named 1892 11월 19  2009 named.ca
-rwxrwxr-x 1 named named  424 11월 19  2009 named.ip6.local
-rwxrwxr-x 1 named named  426 11월 19  2009 named.local
-rwxrwxr-x 1 named named  427 11월 19  2009 named.zero
drwxrwxr-x 2 named named 4096 11월 19  2009 slaves

Master Server (적용)

# service named restart

Slave Server (적용 후)

# service named restart

- ast008.zone 파일의 생성 확인 -

[root@su2-localhost ~]# ll /var/named
합계 84
-rw-r--r-- 1 named named  415  3월 20 11:07 ast008.zone
drwxrwxr-x 3 named named 4096  3월 20 10:03 chroot
drwxrwxr-x 2 named named 4096 11월 19  2009 data
-rwxrwxr-x 1 named named  198 11월 19  2009 localdomain.zone
-rwxrwxr-x 1 named named  195 11월 19  2009 localhost.zone
-rwxrwxr-x 1 named named  427 11월 19  2009 named.broadcast
-rwxrwxr-x 1 named named 1892 11월 19  2009 named.ca
-rwxrwxr-x 1 named named  424 11월 19  2009 named.ip6.local
-rwxrwxr-x 1 named named  426 11월 19  2009 named.local
-rwxrwxr-x 1 named named  427 11월 19  2009 named.zero
drwxrwxr-x 2 named named 4096 11월 19  2009 slaves


- zone 파일 내용 -


[root@su2-localhost ~]# cat /var/named/ast008.zone
$ORIGIN .
$TTL 86400      ; 1 day
ast008.org              IN SOA  ns.ast008.org. root.ns.ast008.org. (
                                1997022722 ; serial
                                1          ; refresh (1 second)
                                14400      ; retry (4 hours)
                                3600000    ; expire (5 weeks 6 days 16 hours)
                                86400      ; minimum (1 day)
                                )
                        NS      ns.ast008.org.
                        A       192.168.10.237
                        MX      10 mail.ast008.org.
$ORIGIN ast008.org.
mail                    A       192.168.10.240
ns                      A       192.168.10.237
www                     CNAME   ns


② slave zone파일의 동기화 확인 (also-notify)    
- bind ver.8.6? 부터 사용 가능

Master Server (변경 전)

- named.conf -

options {
directory "/var/named";
};
zone "." {
type hint;
file "named.ca";
};
zone "ast008.org" {
type master;
file "ast008.zone";
notify yes;
#allow-update{ 192.168.10.239; };
also-notify{ 192.168.10.239; };
};
zone "ast008-2.org" {
type master;
file "ast008-2.zone";
};

- ast008.zone -

[root@dns-localhost ~]# vi /var/named/ast008.zone
$TTL    86400
@   IN   SOA  ns.ast008.org.   root.ns.ast008.org. (
                                   1997022723   ; Serial
                                   00001        ; Refresh
                                   14400        ; Retry
                                   3600000      ; Expire
                                   86400 )      ; Minimum
; Name Server
   IN   NS      ns.ast008.org.
; Mail Exchange
   IN   MX      10      mail.ast008.org.
; Host address
         IN     A   192.168.10.237
ns       IN     A   192.168.10.237
mail     IN     A   192.168.10.240
dj       IN     A   192.168.10.239
dj2      IN     A   192.168.10.238 (이것을 삭제해볼 예정)
;
www      IN     CNAME  ns

# service named restart

Slave Server (변경 전 동기화)

# service named restart

[root@su2-localhost ~]# cat /var/named/ast008.zone
$ORIGIN .
$TTL 86400      ; 1 day
ast008.org              IN SOA  ns.ast008.org. root.ns.ast008.org. (
                                1997022723 ; serial
                                1          ; refresh (1 second)
                                14400      ; retry (4 hours)
                                3600000    ; expire (5 weeks 6 days 16 hours)
                                86400      ; minimum (1 day)
                                )
                        NS      ns.ast008.org.
                        A       192.168.10.237
                        MX      10 mail.ast008.org.
$ORIGIN ast008.org.
dj                      A       192.168.10.239
dj2                     A       192.168.10.238 (삭제하는 것으로 변경)
mail                    A       192.168.10.240
ns                      A       192.168.10.237
www                     CNAME   ns

Master Server (변경 후)

[root@dns-localhost ~]# vi /var/named/ast008.zone
$TTL    86400
@   IN   SOA  ns.ast008.org.   root.ns.ast008.org. (
                                   1997022724   ; Serial
                                   00001        ; Refresh
                                   14400        ; Retry
                                   3600000      ; Expire
                                   86400 )      ; Minimum
; Name Server
   IN   NS      ns.ast008.org.
; Mail Exchange
   IN   MX      10      mail.ast008.org.
; Host address
         IN     A   192.168.10.237
ns       IN     A   192.168.10.237
mail     IN     A   192.168.10.240
dj       IN     A   192.168.10.239
;
www      IN     CNAME  ns


Slave Server(변경 후 동기화)

[root@su2-localhost ~]# cat /var/named/ast008.zone
$ORIGIN .
$TTL 86400      ; 1 day
ast008.org              IN SOA  ns.ast008.org. root.ns.ast008.org. (
                                1997022724 ; serial
                                1          ; refresh (1 second)
                                14400      ; retry (4 hours)
                                3600000    ; expire (5 weeks 6 days 16 hours)
                                86400      ; minimum (1 day)
                                )
                        NS      ns.ast008.org.
                        A       192.168.10.237
                        MX      10 mail.ast008.org.
$ORIGIN ast008.org.
dj                      A       192.168.10.239
mail                    A       192.168.10.240
ns                      A       192.168.10.237
www                     CNAME   ns

- 동기화로 zone 파일의 내용변경 확인 -

댓글

이 블로그의 인기 게시물

Linux Server - FTP 실습 (2 / 2) : 사용자 제한 ( ftpuser / user_list )

전자서명 개념

3.27 (화) - Network (패킷 통신 - 4가지 지연)