FedoraCore3 架DNS



贊助商連結


頁 : [1] 2 3

paul.us
2004-12-26, 11:30 AM
Linux新手請教;架完DNS後執行nslookup網域名稱(例nslookup abc.com)無法對應實體ip,執行nslookup dns主機(例nslookup dns.abc.com)可對應在.com登記的對應ip及相關資料,檢查執行過程(log)發現named.conf執行過程只出現一則找不到正解記錄檔錯誤,但在/van/named/chroot/var/named下有正解記錄檔,請各位先學指點一二謝謝.

贊助商連結


no1adsl
2004-12-26, 04:37 PM
Linux新手請教;架完DNS後執行nslookup網域名稱(例nslookup abc.com)無法對應實體ip,執行nslookup dns主機(例nslookup dns.abc.com)可對應在.com登記的對應ip及相關資料,檢查執行過程(log)發現named.conf執行過程只出現一則找不到正解記錄檔錯誤,但在/van/named/chroot/var/named下有正解記錄檔,請各位先學指點一二謝謝.
/var/named/chroot/etc/named.conf

zone "abc.com" {
type master;
file "FILENAME";
};


位於 /var/named/chroot/var/named 的正解紀錄檔名跟紅色那裡一樣嗎?

paul.us
2004-12-26, 06:41 PM
謝謝你的答覆,我是依施威銘研究室FedoraCore2 Linux架站實務一書指導修改/var/named/chroot/etc/named.conf內容如下(註解部分略去,假設abc.com是我註冊的網域名稱, name.abc.com 是位於/var/named/chroot/var/named/底下的正解記錄檔, named.111.222.110是位於/var/named/chroot/var/named/底下的反解記錄檔,110.222.111.xxx 是實體ip):
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

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

zone "localdomain" IN {
type master;
file "localdomain.zone";
allow-update { none; };
};

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 "abc.com" IN {
type master;
file "name.abc.com";
allow-update { none; };
};

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


include "/etc/rndc.key";

********************
請指教!

no1adsl
2004-12-26, 09:35 PM
修改/var/named/chroot/etc/named.conf 內容如下
註解部分略去,

zone "abc.com" IN {
type master;
file "name.abc.com";
allow-update { none; };
};

假設abc.com是我註冊的網域名稱,
name.abc.com 是位於 /var/named/chroot/var/named/ 底下的正解檔,
named.111.222.110 是位於/var/named/chroot/var/named/ 底下的反解


按造你的做法
你有建立一個 /var/named/chroot/var/named/name.abc.com 的檔案嗎?



你也可以參考以下的做法 :)


1. /var/named/chroot/etc/named.conf 新增如下

zone "mydomain.com" IN {
type master;
file "db.mydomain.com";
};



2. 創建檔案/var/named/chroot/var/named/db.mydomain.com
(創建的檔案名稱,要跟db.mydomain.com一樣)
內容大致如下

$TTL 86400
mydomain.com. IN SOA dns.mydomain.com. your.mail.com. (
2004122621 ; serial
10800 ; refresh
3600 ; retry
604800 ; expire
86400 ; Negative Caching
)
;
mydomain.com. IN NS dns.mydomain.com.
dns.mydomain.com IN A 11.22.33.44
;
mydomain.com. IN A 11.22.33.45
;



註解:
1. db.mydomain.com 可以自由命名
2. mydomain.com. 改為你的網域名
3. dns.mydomain.com. 改為你的DNS名
4. your.mail.com. 改為你的信箱位置 (此例是 your@mail.com,不能用@)
5. serialˋrefreshˋretryˋexpireˋNegative Caching 如果沒有架設第二台DNS的話,可以不必理會

paul.us
2004-12-27, 07:47 AM
no1adsl兄: 附上正反解檔內容及執行log(mdns.abc.com是註冊的主dns之FQDN,sdns.abc.com是註冊的次dns之FQDN,發現錯誤的地方我以 *-----* 標示)請參考********************** /var/named/chroot/var/named/named.abc.com (我的正解)**************************

$TTL 86400
abc.com IN SOA mdns.abc.com. myemail.support.isp. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
abc.com IN NS mdns.abc.com.
mdns.abc.com. IN A 111.222.101.102



**************** /var/named/chroot/var/named/named.111.222.101(我的反解) ****************************

$TTL 86400
abc.com IN SOA mdns.abc.com. myemail.support.isp. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS mdns.abc.com.
101 IN PTR mdns.abc.com.


********************** 執行過程及log *********************

[root@mdns ~]# cd /root
[root@mdns ~]# /etc/rc.d/init.d/named start
Starting named: [ OK ]
You have new mail in /var/spool/mail/root
[root@mdns ~]# nslookup
> abc.com
*---------------*
;; connection timed out; no servers could be reached
*---------------*
> mdns.abc.com
Server: 168.95.192.1
Address: 168.95.192.1#53

Non-authoritative answer:
Name: mdns.abc.com
Address: 111.222.101.102
> exit

[root@mdns ~]# tail -n 15 /var/log/messages
Dec 22 04:02:55 mdns named: named startup succeeded
Dec 22 04:02:55 mdns named[3644]: starting BIND 9.2.4 -u named -t /var/named/chr oot
Dec 22 04:02:55 mdns named[3644]: using 1 CPU
Dec 22 04:02:55 mdns named[3644]: loading configuration from '/etc/named.conf'
Dec 22 04:02:55 mdns named[3644]: listening on IPv4 interface lo, 127.0.0.1#53
Dec 22 04:02:55 mdns named[3644]: listening on IPv4 interface eth0, 220.130.168. 181#53
Dec 22 04:02:55 mdns named[3644]: listening on IPv4 interface eth1, 10.10.1.5#53
Dec 22 04:02:55 mdns named[3644]: command channel listening on 127.0.0.1#953
Dec 22 04:02:55 mdns named[3644]: zone 0.0.127.in-addr.arpa/IN: loaded serial 19 97022700
Dec 22 04:02:55 mdns named[3644]: zone 101.222.111.in-addr.arpa/IN: loaded seria l 1997022700
*---------------*
Dec 22 04:02:55 mdns named[3644]: zone abc.com/IN: loading master file name. abc.com: file not found
*---------------*
Dec 22 04:02:55 mdns named[3644]: zone localdomain/IN: loaded serial 42
Dec 22 04:02:55 mdns named[3644]: zone localhost/IN: loaded serial 42
Dec 22 04:02:55 mdns named[3644]: running
Dec 22 04:04:02 mdns crond(pam_unix)[3199]: session closed for user root
//***** 上面所查到的error只有oading master file name. abc.com: file not found ********

[root@mdns ~]# dig mdns.abc.com
; <<>> DiG 9.2.4 <<>> mdns.abc.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61024
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;mdns.abc.com. IN A

;; ANSWER SECTION:
mdns.abc.com. 150682 IN A 111.222.101.102

;; AUTHORITY SECTION:
abc.com. 158916 IN NS mdns.abc.com.
abc.com. 158916 IN NS sdns.abc.com.

;; ADDITIONAL SECTION:
mdns.abc.com. 150682 IN A 111.222.101.102
sdns.abc.com. 150682 IN A 111.222.101.103

;; Query time: 177 msec
;; SERVER: 168.95.192.1#53(168.95.192.1)
;; WHEN: Wed Dec 22 04:06:03 2004
;; MSG SIZE rcvd: 126

p.s.希望大家提供意見幫助其他的同好

no1adsl
2004-12-27, 10:46 AM
no1adsl兄: 附上正反解檔內容及執行log

*****/var/named/chroot/var/named/named.abc.com (我的正解)*****
*****/var/named/chroot/var/named/named.111.222.101(我的反解)*****

*****執行過程及log*****
*---------------*
Dec 22 04:02:55 mdns named[3644]: zone abc.com/IN: loading master file name. abc.com: file not found
*---------------*
p.s.希望大家提供意見幫助其他的同好
file name.abc.com: file not found

這裡檔名錯誤啦 :)

你的正解檔案名稱是 named.abc.com
而不是 named.conf 裡面所設定的 name.abc.com

----------
跟我一開始問你的問題一樣 ^^"

paul.us
2004-12-28, 06:23 PM
no1adsl兄:
檔名錯誤修正後,DNS執行log顯示運作正常沒錯誤,剛才查了一下FIREWALL 記錄沒顯示擋住任何tcp 或upd ,目前狀況nslookup 網域名稱 得到信息為can’t find網域名稱:No answer, nslookup DNS主機FQDN 可查到註冊實體IP,還有其他要設定的地方嗎?

no1adsl
2004-12-28, 08:10 PM
no1adsl兄:
目前狀況nslookup 網域名稱
得到信息為 can’t find 網域名稱:No answer,
nslookup DNS主機FQDN 可查到註冊實體IP,
還有其他要設定的地方嗎?

1. 你向哪一個DNS查詢網域名稱?
2. 你架設的DNS裡面 , 有 網域名稱 的 A紀錄 嗎?

paul.us
2004-12-28, 09:42 PM
請參考No.5 窗口,log中
1.經168.95.1.1或168.95.192.1#53向上查.com
請參考No.5 窗口,正解檔案
2. A紀錄於正解檔案中:
abc.com IN NS mdns.abc.com.
mdns.abc.com. IN A 111.222.101.102

no1adsl
2004-12-28, 10:11 PM
請參考No.5 窗口,log中
1.經168.95.1.1或168.95.192.1#53向上查.com
請參考No.5 窗口,正解檔案
2. A紀錄於正解檔案中:
abc.com IN NS mdns.abc.com.
mdns.abc.com. IN A 111.222.101.102

你沒指定 abc.com IN A ooo.ooo.ooo.ooo (或 www.abc.com IN A ooo.ooo.ooo.ooo)
那查詢 abc.com (或 www.abc.com) 的 A record
當然找不到... :|||: