Linux Server - DNS 실습 (2 / 6) : DNS Server에 도메인 추가하기
DNS Server에 도메인 추가하기
local nameserver - 네트워크 어댑터에 설정한 네임서버
local nameserver를 세팅하라 - 클라이언트 측에서 네임서버를 지정하라는 뜻
◎ nameserver가 받는 질의 2가지
▷ 자신이 관리하고 있는 도메인 질의▷ 자신이 관리하고 있지 않는 도메인 질의 - 루트서버를 통한 검색
* named.conf 파일 내용 (예시)
※ DNS의 질의는 host명을 가져와서 host의 ip 주소를 묻는 것이지,
도메인 주소를 묻는게 아니다! (중요)
◎ Type
- hint type : 누군가 나에게 질의했을때 내가 모르는 내용이었다. -> 루트에게 질의
- master type : 누군가 나에게 질의했을때 내가 관리하는 내용이었다.
▷ 해당 파일을 열어보면 내용이 들어있다
○ itclass.zone에는 호스트 명과 ip 주소만 들어있으면 된다.
○ 지금은 사용하지 않는 reverse.zone -> ip 주소를 가져와서 호스트 명을 묻는.. (안 씀)
○ name server를 여러 대 둘 필요는 없다 - 자원을 많이 쓰지 않음
▷ 하나의 name server에 여러 개의 도메인을 추가하면 그만
◎ 두 개 이상의 name server를 만들 때, 2개의 name server가 아닌 slave name server를
만드는 이유는? - 보안상의 문제가 있을 가능성 때문에
- 똑같은 정보를 하드카피하게 됨
▷ 한 쪽의 정보가 바뀔 때, 두 서버의 정보가 달라짐 (무결성의 error)
→ 대처 : 정보의 수정은 한 서버에서만, 나머지 서버는 자동으로 Sync
● DNS Server에 도메인 추가
① bind의 설치 확인
[root@dns-localhost ~]# yum list bind
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
base | 1.1 kB 00:00
update | 951 B 00:00
extras | 951 B 00:00
Installed Packages
bind.x86_64 30:9.3.6-4.P1.SUL2.1 installed
Available Packages
bind.x86_64 30:9.3.6-25.P1.el5_11.12 update
② bind-chroot의 삭제
[root@dns-localhost ~]# yum -y remove bind-chroot
③ selinux 설정 변경 (enforced -> disabled)
[root@dns-localhost ~]# cat /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
④ ntsysv - iptables 비활성화
⑤ /etc/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";
};
zone "ast008-2.org" {
type master;
file "ast008-2.zone";
};
[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";
};
zone "ast008-2.org" {
type master;
file "ast008-2.zone";
};
⑥ /var/named/ast008.zone의 생성
[root@dns-localhost ~]# cat /var/named/ast008.zone
$TTL 86400
@ IN SOA ns.ast008.org. root.ns.ast008.org. (
1997022701 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
; Name Server
IN NS ns.ast008.org.
; Host address
IN A 211.203.25.158
ns IN A 211.203.25.158
dj IN A 192.168.10.240
;
www IN CNAME ns
$TTL 86400
@ IN SOA ns.ast008.org. root.ns.ast008.org. (
1997022701 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
; Name Server
IN NS ns.ast008.org.
; Host address
IN A 211.203.25.158
ns IN A 211.203.25.158
dj IN A 192.168.10.240
;
www IN CNAME ns
⑦ /var/named/ast008-2.zone의 생성 (두 번째 nameserver)
[root@dns-localhost ~]# cat /var/named/ast008-2.zone
$TTL 86400
@ IN SOA ns.ast008-2.org. root.ns.ast008-2.org. (
1997022702 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
; Name Server
IN NS ns.ast008-2.org.
; Host address
IN A 211.203.25.158
ns IN A 211.203.25.158
dj IN A 192.168.10.239
;
www IN CNAME ns
$TTL 86400
@ IN SOA ns.ast008-2.org. root.ns.ast008-2.org. (
1997022702 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
; Name Server
IN NS ns.ast008-2.org.
; Host address
IN A 211.203.25.158
ns IN A 211.203.25.158
dj IN A 192.168.10.239
;
www IN CNAME ns
⑧ resolv.conf 수정
[root@dns-localhost ~]# cat /etc/resolv.conf
nameserver 211.203.25.158
nameserver 211.203.25.158
⑨ named 서비스 재시작
[root@dns-localhost ~]# service named restart
named를 정지 중: [ OK ]
named를 시작 중: [ OK ]\
named를 정지 중: [ OK ]
named를 시작 중: [ OK ]\
댓글
댓글 쓰기