【求助】DNS出現 SERVFAIL



贊助商連結


yilang
2004-05-23, 10:57 PM
請問一下:
我在設定Fedora core的DNS時,利用好named.conf以及zone的檔案後,利用nslookup查詢,都會出現 SERVFAIL 的錯誤訊息,查詢目前系統的服務以及通訊埠,都沒有問題,請問一下有那仁兄有遇到相同的情況嗎?謝謝!

贊助商連結


raytracy
2004-05-24, 09:01 AM
最初由 yilang 發表
請問一下:
我在設定Fedora core的DNS時,利用好named.conf以及zone的檔案後,利用nslookup查詢,都會出現 SERVFAIL 的錯誤訊息

那是因為 Fedora 在 /etc/sysconfig/named 中新增了 ROOTDIR 參數所致, 解決方法請參閱:
http://blog.raytracy.com/km/archives/000035.html

yilang
2004-06-05, 10:29 AM
再請問一下:我設定好/var/named/chroot/etc/named.conf,也在/var/named/chroot/var/named中設定好zone file後,我該如果測試,確定先前所設定的zone已經生效了呢?目前的情況是 connection timed out; no servers could be reached ...

麻煩一下了...



最初由 yilang 發表
請問一下:
我在設定Fedora core的DNS時,利用好named.conf以及zone的檔案後,利用nslookup查詢,都會出現 SERVFAIL 的錯誤訊息,查詢目前系統的服務以及通訊埠,都沒有問題,請問一下有那仁兄有遇到相同的情況嗎?謝謝!

raytracy
2004-06-05, 10:48 AM
最初由 yilang 發表
目前的情況是 connection timed out; no servers could be reached ...

您先重新啟動一次 named:

service named restart

然後將 /var/log/messages 裡面, 最後面關於 named 的所有訊息都丟上來看看....也順便將 /etc/sysconfig/named 這個檔案的內容丟上來.

yilang
2004-06-05, 11:48 AM
最初由 raytracy 發表
您先重新啟動一次 named:

service named restart

然後將 /var/log/messages 裡面, 最後面關於 named 的所有訊息都丟上來看看....也順便將 /etc/sysconfig/named 這個檔案的內容丟上來.

重新啟動named時,會發生錯誤...
----------------------------------
# service named restart
停止 named:rndc: connect failed: connection refused [失敗]
啟動 named: [確定]


以下是messages中關於named的資料...
----------------------------------
[root@server1 local]# cat /var/log/messages | grep named
Jun 5 10:13:01 index named: ­«·s¸ü¤J named failed
Jun 5 10:13:12 index named: named Ãö¾÷ failed
Jun 4 22:13:14 index named[26035]: starting BIND 9.2.2-P3 -u named -t /var/named/chroot
Jun 4 22:13:14 index named[26035]: using 1 CPU
Jun 4 22:13:14 index named[26035]: loading configuration from '/etc/named.conf'
Jun 4 22:13:14 index named[26035]: /etc/named.conf:19: unknown option 'inet'
Jun 4 22:13:14 index named[26035]: loading configuration: failure
Jun 4 22:13:14 index named[26035]: exiting (due to fatal error)
Jun 5 10:13:14 index named: named ±Ò°Ê succeeded
Jun 5 10:13:38 index named: named shutdown failed
Jun 5 10:15:24 server1 named: named ±Ò°Ê succeeded
Jun 4 22:15:24 server1 named[2153]: starting BIND 9.2.2-P3 -u named -t /var/named/chroot
Jun 4 22:15:24 server1 named[2153]: using 1 CPU
Jun 4 22:15:24 server1 named[2153]: loading configuration from '/etc/named.conf'
Jun 4 22:15:24 server1 named[2153]: /etc/named.conf:19: unknown option 'inet'
Jun 4 22:15:24 server1 named[2153]: loading configuration: failure
Jun 4 22:15:24 server1 named[2153]: exiting (due to fatal error)
Jun 5 10:19:17 server1 named: ­«·s¸ü¤J named failed
Jun 5 11:42:38 server1 named: named Ãö¾÷ failed
Jun 4 23:42:40 server1 named[2655]: starting BIND 9.2.2-P3 -u named -t /var/named/chroot
Jun 4 23:42:40 server1 named[2655]: using 1 CPU
Jun 4 23:42:40 server1 named[2655]: loading configuration from '/etc/named.conf'
Jun 4 23:42:40 server1 named[2655]: /etc/named.conf:19: unknown option 'inet'
Jun 5 11:42:40 server1 named: named ±Ò°Ê succeeded
Jun 4 23:42:40 server1 named[2655]: loading configuration: failure
Jun 4 23:42:40 server1 named[2655]: exiting (due to fatal error)



以下是/etc/sysconfig/named的內容
---------------------------------------
# cat /etc/sysconfig/named
# Currently, you can use the following options:
# ROOTDIR="/some/where" -- will run named in a chroot environment.
# you must set up the chroot environment before
# doing this.
# OPTIONS="whatever" -- These additional options will be passed to named
# at startup. Don't add -t here, use ROOTDIR instead.
ROOTDIR=/var/named/chroot



麻煩你幫我troubleshooting了,由log來看,好像是configure檔案有問題...

十分感謝!...

raytracy
2004-06-05, 11:58 AM
最初由 yilang 發表
Jun 4 23:42:40 server1 named[2655]: loading configuration from '/etc/named.conf'
Jun 4 23:42:40 server1 named[2655]: /etc/named.conf:19: unknown option 'inet'
Jun 4 23:42:40 server1 named[2655]: loading configuration: failure
Jun 4 23:42:40 server1 named[2655]: exiting (due to fatal error)

您的 /etc/named.conf 內容有誤!! 所以 named 沒有被啟動.

請將 /etc/named.conf 內容貼出來看看.....

yilang
2004-06-05, 12:11 PM
最初由 raytracy 發表
您的 /etc/named.conf 內容有誤!! 所以 named 沒有被啟動.

請將 /etc/named.conf 內容貼出來看看.....


以下是檔案的內容...
---------------------------------
# cat /etc/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;
};

//
// a caching only nameserver config
//
//controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
//};

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

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 "yahui.idv.tw" IN {
type master;
file "db.yahui.idv.tw";
};


include "/etc/rndc.key";

raytracy
2004-06-05, 12:15 PM
最初由 yilang 發表
以下是檔案的內容...
---------------------------------
//controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
//};
這邊錯了, 上下兩個 // 都應該拿掉:

controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

yilang
2004-06-05, 05:11 PM
最初由 raytracy 發表
這邊錯了, 上下兩個 // 都應該拿掉:

controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

你好,這部份我也修正了,不過在啟動named時,還是有以下這個錯誤
service named restart
停止 named:rndc: connect failed: connection refused
在/etc/named.conf中有include "/etc/rndc.key";的設定
是否找不到這個檔案呢?但是在 /etc 中這個檔案是存在的...
滿奇怪的...

yilang
2004-06-05, 05:32 PM
最初由 yilang 發表
你好,這部份我也修正了,不過在啟動named時,還是有以下這個錯誤
service named restart
停止 named:rndc: connect failed: connection refused
在/etc/named.conf中有include "/etc/rndc.key";的設定
是否找不到這個檔案呢?但是在 /etc 中這個檔案是存在的...
滿奇怪的...

你好,後來我重新修改/var/named/chroot/etc/named.conf這個檔案,然後將zone file放在/var/named/chroot/var/named中,目前看來可以正常運作了...