티스토리 뷰
HP-UX DNS 구성 방법
여기에서는 구질구질하게 이론적으로 설명을 하지 않고 실제의 예을 들여 설명을 하겠습니다. 그럼으로 예을 보면서 따라 하시면 쉽게 DNS Server을 구성할수 있습니다.
l 간단한 이론
1. DNS 란 ?
- IP-address 을 domain name으로 상호 변환 시켜주는 서버을 말한다.
- Named 데몬은 53번 port 을 사용하며 /etc/named.boot을 참조로 실행한다.
- Server의 구성 권장안
/etc/named.boot (반드시 /etc 아래에 있어야 한다.)
/etc/name.data/db.root , db.[net|domanin]
ex> named.boot 의 내용
; type domain source file/host ;domain hsc.pe.kr / skhsc.co.kr directory /etc/named.data primary 0.0.127.in-addr.arpa db.127.0.0 primary hsc.pe.kr db.hsc primary skhsc.co.kr db.skhsc primary 162.103.210.in-addr.arpa db.210.103.162 cache . db.cache |
Directory ; 데이터 파일의 주소 지정
Primary ; 이 호스트는 hsc.pe.kr , skhsc.co.kr 에 대한 1차서버이다.
Primary ; 이 호스트는 127.0.0 ,210.103.162 네트웤에 대한 1차서버이다.
cache ; 이 호스트의 루트 서버 위치는 root.cache입니다.
2. Name server swwictch 구성안
default ; hosts : dns nis files
# "hosts:" and "services:" in this file are used only if the # /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.
Passwd: files Group: files Hosts: files dns Networks: files Protocols: files Rpc: files |
3. DNS start 구성
/etc/rc.config.d/namesvrs 수정
NAMED=1 NAMED_ARGS=”” |
<참고사항>
db.[net|domain]의 내용
- db.hsc
; /etc/named.data/db.hsc ;============================================================================= ; ip-address discription ;============================================================================= ; 203.233.119.1 router ; 203.233.119.2 internet server ; 203.233.119.20-50 sun team ; 203.233.119.100-150 hp team ; 203.233.119.200-254 skd customer support service team
@ IN SOA hsc.pe.kr. root.hsc.pe.kr. ( 20000110 ; Serial Number 10800 ; Refresh after 3 hours 3600 ; Retry after 1 hour 604800 ; Expire after 1 week 86400 ) ; Minimum TTL of 1 day
IN NS hsc.pe.kr. hsc.pe.kr. IN A 210.103.162.1 localhost IN CNAME ns.hsc.pe.kr. router IN A 210.103.162.254 ns IN A 210.103.162.1 www IN A 210.103.162.1 mail IN A 210.103.162.1 IN HINFO "ULTRA140" "SUNOS5.5.1" IN MX 100 ns.skhsc.co.kr. class IN A 210.103.162.4 hp IN A 210.103.162.151 d210 IN A 210.103.162.152 web2 IN A 210.103.162.200 |
- db.210.103.162
; /etc/named.boot/db.210.103.162 @ IN SOA hsc.pe.kr. root.hsc.pe.kr. ( 20000110 ; Serial Number 10800 ; Refresh after 3 hours 3600 ; Retry after 1 hour 604800 ; Expire after 1 week 86400 ) ; Minimum TTL of 1 day 254 IN NS hsc.pe.kr. 254 IN PTR router.hsc.pe.kr. 1 IN PTR ns.hsc.pe.kr. 1 IN PTR www.hsc.pe.kr. 1 IN PTR mail.hsc.pe.kr.
|
/etc/hosts의 내용
# # Internet host table 127.0.0.1 localhost 210.103.162.1 hmtech ns.hsc.pe.kr loghost 210.103.162.151 hp.hsc.pe.kr hp 210.103.162.2 class.hsc.pe.kr class 210.103.162.4 d210.hsc.pe.kr d210 |
l 지금부터 본격적으로 실제 예을 들며 실습을 하자..
[1] Primary DNS server system config 방법
1.
/etc/hosts 안에 모든 host을 추가한다.
–hostname은 도메인 이름으로
설정
<참고사항의 /etc/hosts 참고하세요>
2. 데이터베이스 file 에 관해서 별도의 directory 생성
#mkdir /etc/named.data
#chmod 755 /etc/named.data
3. hosts_to_named 명령에 쓸 매개변수을 만드세요..
- 매개변수을 안만들면 4-1로 바로 가세요..
# cd /etc/named.data
# vi data
-d hsc.pe.kr -n 210.103.162 -b /etc/named.boot -z 210.103.162.1 -Z 210.103.162.1 -r |
# chmod 644 data
4. database 생성
# host_to_named –f data
- 생성되는 file ; /etc/named.boot , /etc/named.data/db.hsc , db.127.0.0 , db.210.103.162
db.cache , boot.sec , boot.sec.save , boot.cacheonly
4-1 database 생성 (매개변수 작성 안할 때)
# host_to_named –d hsc.pe.kr –n 210.103.162 –b /etc/named.boot –z 210.103.162.1
5. /etc/rc.config.d/namesvrs 수정
- 간단한 이론 참조
6. /etc/resolv.conf 생성
# vi /etc/resolv.conf
domain hsc.pe.kr nameserver 210.103.162.1 (1차서버) nameserver 210.103.162.2 (2차서버) |
7. named daemon start
# /sbin/init.d/named start
8. 구동 확인
# nslookup
Default Name Server : ns.hsc.pe.kr
Address : 210.103.162.1
참고사항1 : host의 추가/삭제는 1차서버의 /etc/hosts만 수정을 한 후
# host_to_named –f data 로 database 재생성한후 daemon restart
(수동으로 database을 수정하는 것이 편하다…)
[2] 2차 Name Server 구성하기
1. 1차서버와 같은 이름으로 directory 을 만든다.
# mkdir /etc/named.data
# chmod 755 /etc/named.data
2. 1차서버에서 boot.sec ,boot.sec.save , db.127.0.0 file copy
( rpc / ftp 이용)
# rcp /etc/name.data/boot.sec 2차서버명:/etc/named.data
3. 로컬저장을 원할 경우 db.* file copy
4. named에 대한 부트 file 생성
# cp /etc/named.data/boot.sec /etc/named.boot
5. db.cache 수정
. IN NS ns.hsc.pe.kr
ns.hsc.pe.kr IN A 210.103.162.1
나머진 1차서버의 5~8번 과정과 동일
'OS > Unix' 카테고리의 다른 글
UNIX 기본 명령어 (0) | 2016.05.04 |
---|---|
시스템 정보 확인하기 (0) | 2016.05.04 |