댓글 쓰기 권한이 없습니다. 로그인 하시겠습니까?
[우분투]DNS 서버 설치 - Bind9
Posted in Ubuntu Log by Mummer on Jan 11, 2012
우분투 리눅스에서 Bind 로 DNS 서버 구축하는 방법입니다.
- Bind 설치
- Bind 설정
- named.conf 설정
- Inverse Zone 파일 생성
인버스 존파일은 아이피 주소를 문자로 변환 해주는 역할을 담당 합니다.
- Revers Zone 파일 생성
리버스 존파일은 문자로된 도메인 주소를 아이피로 변환 해주는 역할을 담당합니다.
루프백 리버스 존파일도 만들어 줍니다.
- BIND 재시작
- 도메인 정보 확인
nslookup 명령어로 DNS 서버 정보를 확인 합니다.
dig 명령어로 확인
http://ubuntu.or.kr/wiki/doku.php/네임서버
- Bind 설치
[root@ruo91 ~]# sudo apt-get install bind9
- Bind 설정
- named.conf 설정
[root@ruo91 ~]# vi /etc/bind/named.conf
// 옵션 파일을 불러옵니다.
include "/etc/bind/named.conf.options";
// root 도메인의 정보를 가지고 있는 파일을 지정 해줍니다.
zone "." {
type hint;
file "/etc/bind/db.root";
};
//----------------------------------------------//
// 네임 서버로 사용할 도메인을 지정 해줍니다.
zone "ns.yongbok.com" IN {
type master;
file "/etc/bind/db-yongbok";
};
zone "yongbok.com" IN {
type master;
file "/etc/bind/db-yongbok";
};
//----------------------------------------------//
// 리버스 도메인을 설정 합니다.
// 서버의 아이피 주소를 반대로 적어 주시면 됩니다.
zone "167.41.116.in-addr.arpa" {
type master;
file "/etc/bind/ip-yongbok";
};
zone "0.0.127.in-addr.arpa" {
type master;
file "/etc/bind/loopback-yongbok";
};
include "/etc/bind/named.conf.local";
- Inverse Zone 파일 생성
인버스 존파일은 아이피 주소를 문자로 변환 해주는 역할을 담당 합니다.
[root@ruo91 ~]# vi /etc/bind/db-yongbok
; Inverse Zone
$TTL 604800
@ IN SOA ns.yongbok.com. root.yongbok.com. (
2009052723 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.yongbok.com.
A 116.41.167.x
www A 116.41.167.x
- Revers Zone 파일 생성
리버스 존파일은 문자로된 도메인 주소를 아이피로 변환 해주는 역할을 담당합니다.
[root@ruo91 ~]# vi /etc/bind/ip-yongbok
; Revers Zone
$TTL 604800
@ IN SOA ns.yongbok.com. root.yongbok.com. (
2009052723 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
86400 ) ; Minimum
;
@ IN NS ns.yongbok.com.
5 PTR yongbok.com
5 PTR www.yongbok.com
루프백 리버스 존파일도 만들어 줍니다.
[root@ruo91 ~]# vi /etc/bind/loopback-yongbok
; Loopback zone file
$TTL 604800
@ IN SOA ns.yongbok.com. root.yongbok.com. (
2009052723 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
86400 ) ; Minimum
;
@ IN NS ns.yongbok.com.
1 PTR localhost.
- BIND 재시작
[root@yongbok ~]# /etc/init.d/bind9 restart
* Stopping domain name service... bind [ OK ]
* Starting domain name service... bind [ OK ]
- 도메인 정보 확인
nslookup 명령어로 DNS 서버 정보를 확인 합니다.
[root@yongbok ~]# nslookup www.yongbok.com
Server: 168.126.63.1
Address: 168.126.63.1#53
Non-authoritative answer:
Name: www.yongbok.net
Address: 116.41.167.x
dig 명령어로 확인
[root@yongbok ~]# dig ns.yongbok.net NS
; <<>> DiG 9.6.1-P1 <<>> ns.yongbok.net NS
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61983
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; QUESTION SECTION:
;ns.yongbok.net. IN NS
;; ANSWER SECTION:
ns.yongbok.net. 10 IN NS ns.yongbok.net.
;; ADDITIONAL SECTION:
ns.yongbok.net. 10 IN A 116.41.167.x
;; Query time: 5 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed May 26 18:35:04 2010
;; MSG SIZE rcvd: 62
http://ubuntu.or.kr/wiki/doku.php/네임서버