질문&답변
클라우드/리눅스에 관한 질문과 답변을 주고 받는 곳입니다.
리눅스 분류

dns 설정 질문

작성자 정보

  • 한종훈 작성
  • 작성일

컨텐츠 정보

본문

centos 5.2를 사용하고 있습니다. 질문 드릴 내용은 다음과 같습니다.

내부 Dns를 구성하여 Dhcp로 내부망에 네트웍 구성을 하고, 내부망의 사용자가 인터넷을 사용 할려구 하면,

원하는 페이지(172.16.1.20)로 이동하게끔 할려구 합니다.

어떻게 설정해야 되는지 알려 주십시요.

named.caching-nameser.conf(/etc/named.caching-nameser.conf) 설정 내용입니다.

//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver 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.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
options {
        listen-on port 53 { 127.0.0.1; };
//      listen-on-v6 port 53 { ::1; }; ip6설정
        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";
        query-source    port 53;
        query-source-v6 port 53;
//      allow-query     { localhost; };
        allow-transfer { 172.16.1.10; };
        allow-query     { any; };
        allow-notify    { 172.16.1.10; };
        recursion no;
        check-names master ignore;
        check-names slave ignore;
};
// 로깅파일 생성부분
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
view localhost_resolver {
//        match-clients      { localhost; };
//        match-destinations { localhost; };
        match-clients      { any; };
        match-destinations { any; };

        recursion yes;
        include "/etc/named.rfc1912.zones";
};

/etc/named.rfc1912.zones 설정 내용

// named.rfc1912.zones:
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
//
// 루트 도메인 설정

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

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

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

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

zone "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.ip6.local";
 allow-update { none; };
};
/*
zone "255.in-addr.arpa" IN {
 type master;
 file "named.broadcast";
 allow-update { none; };
};

zone "0.in-addr.arpa" IN {
 type master;
 file "named.zero";
 allow-update { none; };
};
*/
zone "xxx.co.kr" IN {
 type master;
 file "xxx.co.kr.zone";
 allow-update { none; };
};

zone "0.16.172.in-addr.arpa" IN {
 type master;
 file "xxx.co.kr.rev";
 allow-update { none; };
};

xxx.co.kr.zone 설정 내용

$TTL 1
@       IN      SOA     xxx.co.kr.  root.xxx.co.kr. (
                        2008090802      ; Serial
                        1H              ; Refresh 3 hours
                        10M             ; Retry 1 hour
                        1W              ; Expired 1000 hours
                        86400   )       ; Minimum 24 hours
 
 IN NS xxx.co.kr.
 IN A 117.16.1.20
www IN A 172.16.1.20
xxx.xxx.co.kr IN A xxx.xxx.xxx.1//여기만 공인 아이피
www.naver.com IN A 172.16.1.20


감사합니다.

 


 

관련자료

댓글 2

한종훈님의 댓글

  • 한종훈
  • 작성일
참고로 iptables 는 중지시킨후에 진행하였습니다.
위의 설정대로 service named start하면 ok 메시지가 나오는데, 내부 네트웍에서 xxx.co.kr로 접속하면 접속이 되지 않습니다.

한종훈님의 댓글

  • 한종훈
  • 작성일
해결했습니다. ㅠㅠ
service named start 했을때 ok가 떨어지고, 로그에서 xxx.co.kr.zone에 관련된 로그가 올라오면...
cd /var/named
chgrp named *.zone으로 하시고
내부망에서 nslookup했을때 서버를 못찾는다면
/etc/named.caching-nameser.conf 중에서
listen-on port 53 { 127.0.0.1; }; 이 부분을 주석처리 해주시면 되겠습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,138 명
  • 현재 강좌수 :  36,200 개
  • 현재 접속자 :  266 명