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 -
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGuOcLI8K64W8aVZZ0uf7wTVWSHtw7lQZVzcdsPIFTcxzrieYntX0bfkb6-WJRDuNvP0RKAOMpyOMEjiPohu6W_Cvkz5OcN9ryF-JuiKO8d8V9edUuYI6zIUjlRskvTBAMR-q6-9oais4/s1600/au+%25EB%25B3%2580%25EA%25B2%25BD+%25EC%25A0%2584+%2528master%2529.PNG)
[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 -
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizNdQwMXRitcE_TCAi3oK74xH_ej2y_W2-LLkMo26bdHlK6fGGjGgvMtW6qmmIKy2bO-nV8ZJyz0-VsuP0k_HMTg6h8PJxcrnuwuJgz0aThzvtYfCsLhRhWKCm-6Hs5-IWY-oNZan3Ku0/s1600/au+%25EB%25B3%2580%25EA%25B2%25BD+%25EC%25A0%2584+-+2+%2528master%2529.PNG)
[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
▶ 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";
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 파일 -
- 아직은 없는 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
# service named restart
[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 {
notify yes;
Master Server (변경 후)
- 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";
#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
# 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
[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 파일의 내용변경 확인 -
댓글
댓글 쓰기