论坛: UNIX系统 标题: dns问题 复制本贴地址    
作者: jkm [jkm]    论坛用户   登录
我在自己机器上弄了个dns服务,属于cache的那种(由于不是直接联上internet所以没法用主dns模式),工作起来正常,但在一次客户机提供请求之后,如果第二次提供相同请求的时间稍微长一点,服务器就会向上级服务器提出解析请求(从tcpdump可以看到),怎么可以延长这个时间?就是比如第二次相同的请求在同一天之内就不必再向上级dns发请求,直接从自己的cache中取出。是不是可以建立一个cache文件并进行相应设定?

地主 发表时间: 07/27 06:41

回复: NetDemon [netdemon]   ADMIN   登录
应该是你配置有误
把配置文件贴上来看看

B1层 发表时间: 07/27 07:28

回复: syshunter [syshunter]   版主   登录
你设置的是转发器,要是2K的话就在“老化与清理”里设置

B2层 发表时间: 07/27 20:24

回复: jkm [jkm]   论坛用户   登录
系统是redhat 7.3,机器在工作的地方,现在贴不了。:(
到时候贴出来看看

B3层 发表时间: 07/27 21:09

回复: jkm [jkm]   论坛用户   登录
named.conf
// generated by named-bootconf.pl


options {
        directory "/var/named";
        /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
        // query-source address * port 53;
        forwarders {10.137.3.5;10.137.1.3;10.137.1.2;};
};

//
// a caching only nameserver config
//
controls {
        inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
        type hint;
        file "named.ca";
};

zone "zy-power.com" IN {
        type master;
        file "zy-power.com";
        allow-update { none; };
};

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

zone "19.137.10.in-addr.arpa" IN {
        type master;
        file "19.137.10";
};

#include "/etc/rndc.key";



19.137.10
$TTL    2147483647
@               IN      SOA     ns.zy-power.com.   root.zy-power.com. (

                        2000080501 ; serial

                        28800 ; refresh

                        7200 ; retry

                        604800 ; expire

                        86400 ; default_ttl

                        )

@             IN      NS                ns.zy-power.com.

;

;       SERVER SECTION

;

22             IN      PTR               www.zy-power.com.

20             IN      PTR               mail.zy-power.com.

20             IN      PTR               ns.zy-power.com.

20             IN      PTR               ftp.zy-power.com.



localhost.zone
$TTL    2147483647
$ORIGIN localhost.
@                       1D IN SOA       @ root (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

                        1D IN NS        @
                        1D IN A         127.0.0.1



named.ca
$TTL    2147483647
@       IN      SOA     localhost. root.localhost.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
              IN      NS      localhost.

1       IN      PTR     localhost.



zy-power.com
$TTL    2147483647
@       IN      SOA     ns.zy-power.com.    root.zy-power.com. (

                        2000080701 ; serial

                        28800 ; refresh

                        7200 ; retry

                        604800 ; expire

                        86400 ; default_ttl

                        )

@                       IN              A       10.137.19.22

@                       IN              NS      ns.zy-power.com.

@                       IN              MX      10  mail.zy-power.com.

localhost               IN              A       127.0.0.1

www                     IN              A       10.137.19.22

mail                    IN              A       10.137.19.20

ns                      IN              A       10.137.19.20

ftp                     IN              A       10.137.19.20


有个问题就是/etc/rndc.key不存在,找来找去没有

B4层 发表时间: 07/29 07:51

论坛: UNIX系统

20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon

粤ICP备05087286号