設置bind,本地不能解析自己主機上內容,client解析正常!!
大家好,我設置完bind后;
在client解析域名:
nslookup ns.example.com 是正常的;
但是在dns伺服器自己上解析。確解析不了(/etc/reslove文件已經指向了dns伺服器自己),顯示為:
# nslookup ns.example.com
Server: 192.168.59.120
Address: 192.168.59.120#53
** server can't find ns.example.com.example.com: SERVFAIL
《解決方案》
本帖最後由 silty 於 2010-03-16 22:12 編輯
注意:** server can't find ns.example.com.example.com: SERVFAIL,可能是resolv.conf文件中domain設置為「example.com」
解決方法:
刪除resolv.conf中的domain,或者在nslookup所解析域名後面加上根域「.」後綴,即「nslookup ns.example.com.」
《解決方案》
回復 2# silty
我在resolv.conf文件中沒有設置domain相關參數啊,我設置了:
search example.com
nameserver 192.168.59.120
《解決方案》
1.刪除resolv.conf中的「search example.com」
2.把測試域名後面加上「.」,即「ns.example.com.」
《解決方案》
回復 4# llzqq
照樓上做了,還是不行,提示:
# nslookup ns.example.com.
Server: 192.168.59.120
Address: 192.168.59.120#53
** server can't find ns.example: SERVFAIL
# cat /etc/resolv.conf
nameserver 192.168.59.120
客戶端就是正確的!可以解析!
《解決方案》
貼出你的name.conf文件和zone文件
《解決方案》
建議用DIG工具測試,會用更多信息來找到問題。
《解決方案》
回復 6# silty
named.conf:
# vi named.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 { any;127.0.0.1; };
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";
// Those options should be used carefully because they disable port
// randomization
query-source port 53;
// query-source-v6 port 53;
allow-query { any; };
allow-query-cache { any; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { localhost; };
match-destinations { localhost; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
view example {
match-clients { any; };
match-destinations { any; };
recursion yes;
include "/etc/named.rfc.zones";
named.rfc.zone:
//newbiiz.com
zone "newbiiz.com" IN {
type master;
file "example.com";
allow-update { none; };
};
zone "59.168.192.in-addr.arpa" IN {
type master;
file "named.example";
allow-update { none; };
};
example.com
@ IN SOA ns.example.com. root.example.com. (
50 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS ns
IN A 192.168.59.120
ns IN A 192.168.59.120
mail IN CNAME ns
《解決方案》
view localhost_resolver {
match-clients { localhost; };
match-destinations { localhost; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
猜測應該是這裡出的問題:localhost為127.0.0.1或Server自身IP,所以調用的是"/etc/named.rfc1912.zones",而該文件並定義example.com域,導致出錯。
樓主註釋掉「view」,僅保留"/etc/named.rfc.zones"或者將"/etc/named.rfc1912.zones"修改為"/etc/named.rfc.zones"試一試
(僅是猜測,未驗證)
《解決方案》
回復 9# silty
多謝樓上的鼎力相助,困擾我千年的難題,就此解開!!!:emn10: ,Thank you~~~~~