歡迎您光臨本站 註冊首頁

Cache-Only DNS 問題,大家幫忙看一下

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

Cache-Only DNS 問題,大家幫忙看一下

我架了一個簡易的Cache-Only DNS 伺服器,配置文件如下:


options
{
        /* make named use port 53 for the source of all queries, to allow
         * firewalls to block all ports except 53:
         */
        query-source    port 53;
        query-source-v6 port 53;

        // Put files that named is allowed to write in the data/ directory:
        directory "/var/named"; // the default
        dump-file               "data/cache_dump.db";
        statistics-file         "data/named_stats.txt";
        memstatistics-file      "data/named_mem_stats.txt";
        pid-file                "/var/run/named/named.pid";
        forward  only;
        allow-query{any;};
        Forwarders
        {
            202.96.128.166;
            202.96.128.86;
        };
};
include "/etc/rndc.key";

現在問題是在DNS伺服器本機用host命令等都是可以成功查詢的,比如:

# host www.sina.com 192.168.1.100
Using domain server:
Name: 192.168.1.100
Address: 192.168.1.100#53
Aliases:

www.sina.com is an alias for us.sina.com.cn.
us.sina.com.cn is an alias for news.sina.com.cn.
news.sina.com.cn is an alias for jupiter.sina.com.cn.
jupiter.sina.com.cn is an alias for ara.sina.com.cn.
ara.sina.com.cn has address 58.63.236.26
ara.sina.com.cn has address 58.63.236.31
ara.sina.com.cn has address 58.63.236.32
ara.sina.com.cn has address 58.63.236.33
ara.sina.com.cn has address 58.63.236.34
ara.sina.com.cn has address 58.63.236.35
ara.sina.com.cn has address 58.63.236.36
ara.sina.com.cn has address 58.63.236.37
ara.sina.com.cn has address 58.63.236.38
ara.sina.com.cn has address 58.63.236.39
ara.sina.com.cn has address 58.63.236.40
ara.sina.com.cn has address 58.63.236.41
ara.sina.com.cn has address 58.63.236.42
ara.sina.com.cn has address 58.63.236.43
ara.sina.com.cn has address 58.63.236.44
ara.sina.com.cn has address 58.63.236.45

這樣子我想應該是伺服器已經架設成功了吧?但是在Client 測試卻不行,如下:

# host www.sina.com 192.168.1.100
;; connection timed out; no servers could be reached


求高手指點。
《解決方案》

看看防火牆是否允許訪問53埠
《解決方案》

防火牆是否有開放53埠
《解決方案》

原帖由 chenyx 於 2009-5-30 16:34 發表 http://linux.chinaunix.net/bbs/images/common/back.gif
防火牆是否有開放53埠


防火牆沒有問題。
《解決方案》

學習~~~~~~
《解決方案》

client和server的網路通嗎?
在options里加上listen-on port 53 {127.0.0.1; server的ip;};試試看
《解決方案》

原帖由 gachoyi 於 2009-5-30 20:20 發表 http://linux.chinaunix.net/bbs/images/common/back.gif
client和server的網路通嗎?
在options里加上listen-on port 53 {127.0.0.1; server的ip;};試試看

client和server肯定是沒有問題的,因為client也是靠server的DHCP來分配IP的。
加了以後還是一樣,用netstat -tunlp 查看listen 也正常……
《解決方案》

用dhcp分配的ip啊,
我犯過個錯誤,就是server的named其實沒啟動,在server上查詢成功其實是dhcp提供的那個nameserver
你看看是不是這種情況
《解決方案》

原帖由 gachoyi 於 2009-5-30 22:39 發表 http://linux.chinaunix.net/bbs/images/common/back.gif
用dhcp分配的ip啊,
我犯過個錯誤,就是server的named其實沒啟動,在server上查詢成功其實是dhcp提供的那個nameserver
你看看是不是這種情況

應該不是,因為我在DHCP裡面是這樣寫的:option domain-name-Servers      192.168.1.100;(這個是伺服器IP)
在client裡面的/etc/resolv.conf 也是按上面來設置了,想了一天了,還是沒想到問題所在……

[ 本帖最後由 zngell 於 2009-5-31 17:59 編輯 ]
《解決方案》

鬱悶,剛剛又重新安裝LINUX重新配置了一次,還是同樣的問題!!!

[火星人 ] Cache-Only DNS 問題,大家幫忙看一下已經有488次圍觀

http://coctec.com/docs/service/show-post-22273.html