2012. 11. 12. 05:35


===================================================

DNS 서버 구축하기

===================================================

#sudo apt-get install bind9    //바인드를 시키기 위한 프로그램

#sudo apt-get install dnsutils  //dns 유틸리티



#cat  /etc/bind/named.conf  //네임서버 설정파일이 들어가 있다.

---------------------------------------------------------------------

include "/etc/bind/named.conf.options";

include "/etc/bind/named.conf.local";

include "/etc/bind/named.conf.default-zones";

---------------------------------------------------------------------


# cat /etc/bind/named.conf.options

---------------------------------------------------------------------

options {

directory "/var/cache/bind";


// If there is a firewall between you and nameservers you want

// to talk to, you may need to fix the firewall to allow multiple

// ports to talk.  See http://www.kb.cert.org/vuls/id/800113


// If your ISP provided one or more IP addresses for stable 

// nameservers, you probably want to use them as forwarders.  

// Uncomment the following block, and insert the addresses replacing 

// the all-0's placeholder.


forwarders {

168.126.63.1;

0.0.0.0;

};


auth-nxdomain no;    # conform to RFC1035

listen-on-v6 { any; };

};


---------------------------------------------------------------------

forwarders 는 최후에 어떤 도메인을 검색할지 정해준다. 


# cat /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";

---------------------------------------------------------------------

필자의 경우엔 전부 주석처리 되어 있었다.


#vi /etc/bind/named.conf.default-zones


---------------------------------------------------------------------

// be authoritative for the localhost forward and reverse zones, and for

// broadcast zones as per RFC 1912


zone "aaa" {

        type master;

        file "/etc/bind/db.1";

};


zone "localhost" {

        type master;

        file "/etc/bind/db.local";

};


zone "127.in-addr.arpa" {

        type master;

        file "/etc/bind/db.127";

};


zone "0.in-addr.arpa" {

        type master;

        file "/etc/bind/db.0";

};


zone "255.in-addr.arpa" {

        type master;

        file "/etc/bind/db.255";

};

---------------------------------------------------------------------

위에서 처음부분으 필자가 만들어준 부분이다.

aaa 라는 도메인을 추가하여, /etc/bind/db.1 파일을 참조 하도록 하였다.



하고나서는 반드시 재시작!


#/etc/init.d/bind9 restart

Posted by k1rha