小弟有購買一網址,並將dns網址指向到我的固定IP
再來也設定正解檔xx.fwd 內容是這樣
$TTL 86400
@ IN SOA xxx.tw. root.xxx.tw.(
2014032501 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS xxx.tw.
IN A 111.222.333.444
www IN A 111.222.333.444
dns IN A 111.222.333.444
ftp IN CNAME www
mail IN A 111.222.333.444
@ IN MX 10 mail
反解檔無設(因Hinet非固定轉固定已經取消,所以沒設)
/etc/namedb/named.conf內容是這樣
zone "xxx.tw" {
type master;
file "xx.fwd";
};
root的zone有設上,故不PO上
/etc/resolv.conf內容
domain xxx.tw
nameserver 111.222.333.444
nameserver 168.95.1.1
nameserver 168.95.192.1
請問直接由別台Ping xxx.tw顯示找不到主機
不知道哪裡設錯,可否有大大幫忙??
這類問題你可以用 dig 或是 nslookup 去除錯
看不懂的話就把結果貼上來大家幫你看
dig 是 bind 的工具, 應該在 unix like 系統會有裝, 沒有就自己裝一下
nslookup 是 windows 內建的命令列工具
以檢查 yahoo 的 dns 查詢為例
<pre class="c" name="code">
dig +trace www.yahoo.com.tw
或
nslookup -debug www.yahoo.com.tw
dig 的輸出長這樣子
<pre class="c" name="code">
; <<>> DiG 9.7.0-P1 <<>> +trace www.yahoo.com.tw
;; global options: +cmd
. 7393 IN NS a.root-servers.net.
. 7393 IN NS m.root-servers.net.
. 7393 IN NS f.root-servers.net.
. 7393 IN NS l.root-servers.net.
. 7393 IN NS h.root-servers.net.
. 7393 IN NS i.root-servers.net.
. 7393 IN NS k.root-servers.net.
. 7393 IN NS c.root-servers.net.
. 7393 IN NS d.root-servers.net.
. 7393 IN NS e.root-servers.net.
. 7393 IN NS b.root-servers.net.
. 7393 IN NS j.root-servers.net.
. 7393 IN NS g.root-servers.net.
;; Received 228 bytes from 8.8.8.8#53(8.8.8.8) in 17 ms
tw. 172800 IN NS a.dns.tw.
tw. 172800 IN NS b.dns.tw.
tw. 172800 IN NS c.dns.tw.
tw. 172800 IN NS d.dns.tw.
tw. 172800 IN NS e.dns.tw.
tw. 172800 IN NS f.dns.tw.
tw. 172800 IN NS g.dns.tw.
tw. 172800 IN NS h.dns.tw.
tw. 172800 IN NS ns.twnic.net.
tw. 172800 IN NS sec4.apnic.net.
;; Received 489 bytes from 192.203.230.10#53(e.root-servers.net) in 145 ms
com.tw. 86400 IN NS b.twnic.net.tw.
com.tw. 86400 IN NS c.twnic.net.tw.
com.tw. 86400 IN NS d.twnic.net.tw.
com.tw. 86400 IN NS e.twnic.net.tw.
com.tw. 86400 IN NS f.twnic.net.tw.
com.tw. 86400 IN NS a.twnic.net.tw.
;; Received 376 bytes from 211.20.231.11#53(e.dns.tw) in 9 ms
yahoo.com.tw. 86400 IN NS ns5.yahoo.com.
yahoo.com.tw. 86400 IN NS ns2.yahoo.com.
yahoo.com.tw. 86400 IN NS ns4.yahoo.com.
yahoo.com.tw. 86400 IN NS ns3.yahoo.com.
yahoo.com.tw. 86400 IN NS ns1.yahoo.com.
;; Received 133 bytes from 192.83.166.9#53(a.twnic.net.tw) in 13 ms
www.yahoo.com.tw. 7200 IN CNAME rc.yahoo.com.
rc.yahoo.com. 300 IN CNAME rc.g01.yahoodns.net.
g01.yahoodns.net. 172800 IN NS yf1.yahoo.com.
g01.yahoodns.net. 172800 IN NS yf4.a1.b.yahoo.net.
g01.yahoodns.net. 172800 IN NS yf2.yahoo.com.
g01.yahoodns.net. 172800 IN NS yf3.a1.b.yahoo.net.
;; Received 208 bytes from 119.160.247.124#53(ns5.yahoo.com) in 14 ms
請問"xx.fwd"的內容?
並請貼出/var/log/named.err 與 /var/log/named.war檔案內容
我是用tail /var/log/messages指令
Mar 27 23:07:21 AderskyServer named[3140]: built with '--prefix=/usr' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--enable-threads' '--enable-getifaddrs' '--disable-linux-caps' '--with-openssl=/usr' '--with-randomdev=/dev/random' '--without-idn' '--without-libxml2'
Mar 27 23:07:21 AderskyServer named[3140]: command channel listening on 127.0.0.1#953
Mar 27 23:07:21 AderskyServer named[3140]: zone xxx.tw/IN: loading from master file master/xx.fwd failed: file not found
Mar 27 23:07:21 AderskyServer named[3140]: zone xxx.tw/IN: not loaded due to errors.
Mar 27 23:07:21 AderskyServer named[3140]: managed-keys-zone ./IN: loading from master file managed-keys.bind failed: file not found
Mar 27 23:07:21 AderskyServer named[3140]: running
我需要你貼上三個檔案!
你三個都不貼,只貼上messages檔案內容!
訊息顯示,無此xxx.fwd檔案,所以file not found
所以,沒有xxx.fwd設定檔呀!
這樣子,你知道你的問題,在哪了嗎?
Mar 29 11:38:53 AderskyServer named[1169]: stopping command channel on 127.0.0.1 #953
Mar 29 11:38:53 AderskyServer named[1169]: exiting
Mar 29 11:38:53 AderskyServer named[2288]: starting BIND 9.8.1-P1 -t /var/named -u bind
Mar 29 11:38:53 AderskyServer named[2288]: built with '--prefix=/usr' '--infodir =/usr/share/info' '--mandir=/usr/share/man' '--enable-threads' '--enable-getifad drs' '--disable-linux-caps' '--with-openssl=/usr' '--with-randomdev=/dev/random' '--without-idn' '--without-libxml2'
Mar 29 11:38:53 AderskyServer named[2288]: command channel listening on 127.0.0. 1#953
Mar 29 11:38:53 AderskyServer named[2288]: running