그냥 개발자 블로그

우분투14 서버 버전 dns 서버 구축 본문

프로그래밍팁/linux

우분투14 서버 버전 dns 서버 구축

마음이파파 2015. 12. 6. 16:00





1. 환경

- OS : 우분투14 서버버전

- 고정 아이피 : 27.35.21.239 

- 도메인 : play-ground.kr

- hostname : play-ground.kr

- 공유기 : 53 포트 오픈







2. 네임서버 세팅




도메인을 구입한곳에 네임서버를 다음과 같이 변경해줍니다. 이후 24시간이 지나면 아래를 진행해주세요.









3. bind9 설치


apt-get install bind9 bind9-utils


설치가 되어 있지 않는 경우만 설치하세요. 









4. /etc/hosts 수정


127.0.0.1       localhost

127.0.1.1       play-ground.kr

27.35.21.239    play-ground.kr


# The following lines are desirable for IPv6 capable hosts

::1     localhost ip6-localhost ip6-loopback

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters


다음과 같이 하얀색으로 표시된것처럼 추가 해줍니다.








5. /etc/resolv.conf 수정


# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)

#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

nameserver 127.0.1.1

nameserver 59.187.192.80

nameserver 164.124.101.2


네임서버로 현재서버를 추가 합니다.








6. /etc/bind/named.conf.local 수정




// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

zone "play-ground.kr"{
        type master;
        file "/etc/bind/db.play-ground.kr";
};








7. db.local 복사 해서 db.play-ground.kr 만들기

cp db.local db.play-ground.kr









8. /etc/bind/db.play-ground.kr 수정

;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     play-ground.kr. root.play-ground.kr. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      na.play-ground.kr.
@       IN      A       27.35.21.239
@       IN      AAAA    ::1
ns      IN      A       28.35.21.239








9. bind9 재시작

service bind9 restart









10. 도메인으로 접속 되는지 테스트