«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Tags more
Archives
Today
Total
05-20 13:42
관리 메뉴

+1-1+1-1+1-1+1-1...

DNS 서버 구성 (bind) 본문

Linux/Sever Mangement

DNS 서버 구성 (bind)

투명인간 2021. 2. 27. 13:57
728x90

1. named.conf 수정

[root@testlab ~]# vim /etc/named.conf
....
options {
// modify : 127.0.0.1 -> any
        listen-on port 53 { any; };
// modify : ::1->none
        listen-on-v6 port 53 { none; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        recursing-file  "/var/named/data/named.recursing";
        secroots-file   "/var/named/data/named.secroots";
        // modify : localhost -> any
        allow-query     { any; };
....
// add : For non-internal domains
        forwarders {
                168.126.63.1;
                8.8.8.8;
        };
....
include "/etc/named.rfc1912.zones";

2. /etc/named.rfc1912.zones 파일에 생성할 도메인(testlab.net) 이름의 zone 파일을 추가

[root@testlab ~]# vim /etc/named.rfc1912.zones
zone "localhost.localdomain" IN {
        type master;
        file "named.localhost";
        allow-update { none; };
};

zone "localhost" IN {
        type master;
        file "named.localhost";
        allow-update { none; };
};

zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
        type master;
        file "named.loopback";
        allow-update { none; };
};

zone "1.0.0.127.in-addr.arpa" IN {
        type master;
        file "named.loopback";
        allow-update { none; };
};

zone "0.in-addr.arpa" IN {
        type master;
        file "named.empty";
        allow-update { none; };
};

// add testlab zone file include
zone "testlab.net" IN {
        type master;                    // server type
        file "testlab.net.zone";      	// zone file
        allow-update {none;};   			// none: no slave to sync
};

zone "168.192.in-addr.arpa" IN {        // Reverse
        type master;
        file "/var/named/rev.168.192.in-addr.arpa";
};

3. /var/named/testlab.net.zone 파일 생성 - A 레코드 등록 관리

[root@testlab ~]# vim /var/named/testlab.net.zone
$TTL 10
@       IN SOA  @ rname.invalid. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        NS      @
        A       192.168.60.10
        AAAA    ::1
www             IN      A       192.168.60.5
TEST-WEB01      IN      A       192.168.60.11

4. /var/named/rev.168.192.in-addr.arpa 파일 수정 - PRT 레코드 등록 관리

[root@testlab ~]# vim /var/named/rev.168.192.in-addr.arpa
$TTL 10

@    IN    SOA    dns.test.local.    root.test.local. (
                                        2017031403      ; serial
                                        1D              ; refresh
                                        1H              ; retry
                                        1W              ; expire
                                        3H )            ; min(Negative cache TTL)

testlab.net.          IN    NS    dns.testlab.net.
dns.testlab.net.    IN    A    192.168.60.10

@      IN NS      dns.testlab.net.
3.0    IN PTR    dns.testlab.net.

참고 사이트

서버셋팅 2. BIND설치와 네임서버(DNS 서버)의 구축 :: 행복한 토끼 (tistory.com)

 

서버셋팅 2. BIND설치와 네임서버(DNS 서버)의 구축

DNS(Domain Name System)서버를 구축하기 위해서는 DNS의 역할을 수행하는 프로그램을 설치해야한다. 리눅스에서 가장 널리 사용되는 프로그램으로 BIND(Berkeley Internet Name Domain)가 있다. (홈페이지 : www...

lovelyhare.tistory.com

 

반응형