免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1572 | 回复: 2
打印 上一主题 下一主题

BIND RHEL5 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-11-18 16:13 |只看该作者 |倒序浏览
Hi linuxers

I am setting up a DNS/BIND for my local office 100 users for resolving
internal (nonroutable) and external names (internet)
for internet usage it works fine but for internal one it shows problems
am not using real name i called only my.lan
my DNS server 10.5.1.30  hostname: linux1.my.lan
my clients having 10.6.x.0/24
my servers having 10.5.0.0/16

my ISP ns1  X.X.X.X
my ISP ns2  Y.Y.Y.Y

can any one tell me what am doing wrong?


root@linuxvmware:~# cat /etc/resolv.conf
nameserver 10.5.1.30
domain my.lan
search my.lan







root@linuxvmware:~# nslookup redhat.com
Server:         10.5.1.30
Address:        10.5.1.30#53

Non-authoritative answer:
Name:   redhat.com
Address: 209.132.177.50

root@linuxvmware:~# dig redhat.com

; <<>> DiG 9.4.1-P1 <<>> redhat.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41276
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 1

;; QUESTION SECTION:
;redhat.com.                    IN      A

;; ANSWER SECTION:
redhat.com.             49      IN      A       209.132.177.50

;; AUTHORITY SECTION:
redhat.com.             370     IN      NS      ns1.redhat.com.
redhat.com.             370     IN      NS      ns2.redhat.com.
redhat.com.             370     IN      NS      ns3.redhat.com.

;; ADDITIONAL SECTION:
ns3.redhat.com.         90304   IN      A       66.187.229.10

;; Query time: 11 msec
;; SERVER: 10.5.1.30#53(10.5.1.30)
;; WHEN: Sun Nov  4 20:58:54 2007
;; MSG SIZE  rcvd: 114



root@linuxvmware:~# dig linux1

; <<>> DiG 9.4.1-P1 <<>> linux1
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 2535
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;linux1.                                IN      A

;; AUTHORITY SECTION:
.                       5874    IN      SOA     A.ROOT-SERVERS.NET. NSTLD.VERISIGN-GRS.COM. 2007111601 1800 900 604800 86400

;; Query time: 2 msec
;; SERVER: 10.5.1.30#53(10.5.1.30)
;; WHEN: Sun Nov  4 20:59:23 2007
;; MSG SIZE  rcvd: 99



root@linuxvmware:~# nslookup linux1
Server:         10.5.1.30
Address:        10.5.1.30#53

** server can't find linux1: NXDOMAIN

root@linuxvmware:~#







/etc/named.caching-nameserver.conf


//
// named.caching-nameserver.conf
//

acl my-lan { 10.5.0.0/16; 10.6.40.0/24; 127.0/8; };

options {
        forwarders { X.X.X.X; Y.Y.Y.Y; }; #IP of upstream ISP nameserver(s)
        //forward only; #rely completely on our upstream nameservers
        listen-on port 53 { 127.0.0.1; 10.5.1.30;};
        listen-on { 10.5.1.30; };
        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";
        query-source    port 53;
        query-source-v6 port 53;
        allow-query     { localhost; my-lan; };
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." {
        type hint;
        file "named.root";
};


# Forward Zone for my.lan domain
zone "my.lan" IN {
        type master;
        file "my.lan.zone";
        allow-query     { localhost; my-lan; };
};

# Reverse Zone for my.lan domain
zone "0.10.in-addr.arpa" IN {
        type master;
           // file "10.0.zone";
           file "10.in-addr.arpa";
         //file "0.10.in-addr.arpa";
        allow-query     { localhost; my-lan; };
};


view localhost_resolver {
        match-clients      { localhost; 10.5.0.0/16; 10.6.40.0/24; 127.0/8; };
        match-destinations { localhost; };
        recursion yes;
        include "/etc/named.rfc1912.zones";
};
~



------------------------------
my.lan.zone

$TTL    12h

@       IN      SOA     linux1.my.lan. pons.my.lan.  (
                                2007052500      ; Serial
                                10800   ; Refresh
                                3600    ; Retry
                                604800  ; Expire
                                86400 ) ; Minimum
;       Name servers
                IN      NS      linux1.my.lan.
;       Mail servers
                IN      MX      5 linux1.my.lan.
;       Individual servers
linux1          IN      A       10.5.1.30
linuxvmware     IN      A       10.6.40.81
mailhost        IN      CNAME   linux1
www             IN      CNAME   linux1


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


10.in-addr.arpa

$TTL    24h
; 10.0.rev
@               IN      SOA     linux1.my.lan pons.my.lan. (
                2007052500
                10800
                3600
                604800
                86400 )

                IN      NS      linux1.my.lan.

10              IN      PTR     linux1.my.lan.
1               IN      PTR     linuxvmware.my.lan.

论坛徽章:
0
2 [报告]
发表于 2007-11-18 18:26 |只看该作者
既然你要用 view 的話, 所有的 zone 都要在 view 區段內.

整個來看您似乎沒打算使用 view 完全區分出內部與外部的話, 請拿掉 view 敘述把裡面內容調整一下,  include 放置於整體敘述, 其他剩下敘述放於 options { ..} 內即可.

--

论坛徽章:
0
3 [报告]
发表于 2007-11-19 02:33 |只看该作者
Can you tell me how should it looks the named config and other files
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP