nns 구축 및 흔한 문제

5015 단어
#####################################################################################dnsybindvim/etc/named 를 구성합니다.conf단계1, listen-on port 53 {127.0.0.1;};주소를 dns 서버의 주소로 바꾸기 절차 2, allow-query {localhost;};주소가 접근할 수 있는 IP 세그먼트로 바뀌었습니다. 예를 들어 192.168.122.0/24 단계 3. 추가 필드는/etc/named를 참고할 수 있습니다.rfc1912.zones 역방향 해석 도메인 이름 형식이 고정되어 있으니 다음과 같이 zone'1.0.0.127.in-addr.arpa'in zone'122.168.192.in-addr.arpa'in {type master;file'192.168.0.rev'를 함부로 쓰면 안 됩니다. }; zone "sh.com"IN {                 type master;                 file "sh.com.hosts"; };
내 프로필 보내기
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
    listen-on port 53 { 192.168.122.20; };
    //listen-on-v6 port 53 { ::1; };
    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";
    allow-query     { 192.168.122.0/24; }; // 
    recursion yes;// DNS 

    dnssec-enable yes;
    dnssec-validation yes;
    dnssec-lookaside auto;

    /* Path to ISC DLV key */
    bindkeys-file "/etc/named.iscdlv.key";

    managed-keys-directory "/var/named/dynamic";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
    type hint;
    file "named.ca";
};

zone "sh.com" IN {
    type master;
    file "sh.com.hosts";
};
zone "122.168.192.in-addr.arpa" IN {
    type master;
    file "192.168.0.rev";
};
key "rndc-key" {
        algorithm hmac-md5;
        secret "xgxzJPDFyVGEFnT44Rw3OA==";
};
controls { 192.168.0.rev
      inet 127.0.0.1 port 953 
              allow { 127.0.0.1; } keys { "rndc-key"; }; 
}; 

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

내 도메인 파일 보내기
sh.com.hosts
$TTL 38400
@    IN SOA     rhel.sh.com. root.sh.com.(
                    1268360234    
                    10800
                    3600    
                    604800    
                    38400 )    
@    IN    NS    rhel.sh.com.
rhel    IN    A    192.168.122.20
linux    IN    A    192.168.122.50
www    IN    CNAME    rhel.sh.com.  
mail       IN    CNAME    rhel.sh.com.
ftp    IN    CNAME     rhel.sh.com.
@    IN    MX    10 mail.sh.com.

 
192.168.0.rev 
$TTL 1D
@    IN SOA     rhel.sh.com. root.sh.com. (
                    0    ; serial
                    1D    ; refresh
                    1H    ; retry
                    1W    ; expire
                    3H )    ; minimum
@    NS    rhel.sh.com.
20    PTR    rhel.sh.com.
50     PTR    linux.sh.com.

ps: 보조 dns 서버를 구축하는 절차와 앞의 두 단계와 같은 추가역의 형식은 다음과 같다. zone "sh.com"IN {type slave;masters {192.168.122.20;};                 file "slaves/sh.com.hosts"; };\\/var/named/slaves 동기화 마스터에서 해당 영역을 추가한 파일을 자동으로 생성합니다.dns 서버를named에 완전히 전송합니다.conf에 fowarders {IP;} 추가; forward only; 조건부 전송 DNS 서버는 도메인에 대해 특정 도메인을 DNS zone "xx.com"IN{type forward;fowarders {IP;}로 전송합니다.         };도메인 위임은 DNS의 부담을 줄이지만 새 호스트가 가상 서브도메인을 사용하면/var/named/지하에만 사용되는 도메인 파일을 간단하게 처리할 수 있습니다. 예를 들어 $ORIGIN sh.com.$ORIGIN xx.sh.com.            IN        NS        leaf.xx.sh.com.leaf IN A 192.168.122.20 편집/etc/resolve.conf에 부모 DNS 서버를 추가하면 캐시 서버가named에 있는지 확인할 수 있습니다.conf에 데이터 크기 예를 들어 100M 추가;도메인 이름sh.com을 직접 사용할 수 있습니다.IN A 192.168.122.2 범도메인 이름 해석 *.sh.com. IN A 192.168.122.2 액세스 제어 named.conf에allow-query{액세스 제어 목록 이름}acl 액세스 제어 목록 이름 {!192.168.122.1:192.168.122.0/24;        };이 세그먼트가 1을 제외한 dns가 bind-chroot에 액세스할 수 있도록 하는 것은 비교적 안전한 dns##########################################################################################################################key "rndc-key"{                algorithm hmac-md5;                        secret "xgxzJPDFyVGEFnT44Rw3OA==";};controls {              inet 127.0.0.1 port 953                            allow { 127.0.0.1; } keys { "rndc-key"; };};/etc/init.d/named 두 줄 오류가 발생했을 때/etc/named에 추가합니다.conf 가능cat/etc/rndc.conf dig 명령을 사용하여 먼저 bind-utilsdig 도메인 이름dig - x ip를 설치합니다.
dig -t 유형 1.DNS를 시작할 때 Generating/etc/rndc.가 나타납니다.키:여기 걸렸어[root@RedHat named]#/etc/init.d/named restartStopping named:                                            [  OK  ]Generating/etc/rndc.key:^C[root@redhatnamed]# 해결 방법: [root@redhat named]# rndc-confgen -r/dev/urandom -awrote key file "/etc/rndc.key"[root@redhat named]#/etc/init.d/named restartStopping named:                                            [  OK  ]Starting named:                                            [  OK  ] linux

좋은 웹페이지 즐겨찾기