VnLamp

Go Back   VnLamp > Khu vực Training > LPI > DNS

Trả lời
 
LinkBack Ðiều Chỉnh Xếp Bài
Cache DNS dùng BIND server can't find server NXDOMAIN
Old
  (#1 (permalink))
 
Status: Offline
Posts: 20
Tham gia: Feb 2008
Junior Member
Default Cache DNS dùng BIND server can't find server NXDOMAIN - 04-05-2009, 10:4 04-05-2009

Tập tin /etc/resolv.conf
Trích:
nameserver 192.168.1.190 //IP của server Linux
nameserver 203.162.4.190 //IP của ISP
Tập tin /etc/sysconfig/network
Trích:
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=server.hoclinux123.com
Tập tin named.conf
Trích:
zone "hoclinux123.com" {
type master;
file "hoclinux123.com.db";
};
zone "1.168.192.in-addr.arpa" {
type master;
file "1.168.192.in-addr.arpa.db";
};

Tập tin /var/named/chroot/var/named/1.168.192.in-addr.arpa.db
Trích:
$TTL 86400
@ IN SOA hoclinux123.com. root.hoclinux123.com.(
2004031901 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS hoclinux123.com.
190 IN PTR hoclinux123.com.
Tập tin /var/named/chroot/var/named/hoclinux123.com.db

Trích:
$TTL 86400
@ IN SOA server.hoclinux123.com. root.hoclinux123.com.(
2006041401 ; Serial
7200 ; Refresh
7200 ; Retry
2419200 ; Expire
86400 ) ; Minimum
IN NS server.hoclinux123.com.
IN MX 10 hoclinux123.com.
server IN A 192.168.1.190
@ IN A 192.168.1.190
www IN A 192.168.1.190
ftp IN A 192.168.1.190
mail IN A 192.168.1.190
Khi start named thì thành công nhưng khi dùng nslookup thì gặp lỗi sau
nslookup server.hoclinux123.com
Server: 203.162.4.190
Address: 203.162.4.190#53

** server can't find server.hoclinux123.com: NXDOMAIN

Trong khi đó mình dùng nslookup từ Google
Trích:
nslookup google.com
Server: 203.162.4.190
Address: 203.162.4.190#53

Non-authoritative answer:
Name: google.com
Address: 74.125.67.100
Name: google.com
Address: 209.85.171.100
Name: google.com
Address: 74.125.45.100
Trong khi đó mình dùng dig dig mx hoclinux123.com

Trích:
; <<>> DiG 9.3.4-P1 <<>> mx hoclinux123.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 48290
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;hoclinux123.com. IN MX

;; AUTHORITY SECTION:
com. 900 IN SOA a.gtld-servers.net. nstld.verisign-grs.com. 1241366672 1800 900 604800 900

;; Query time: 259 msec
;; SERVER: 203.162.4.190#53(203.162.4.190)
;; WHEN: Mon May 4 06:32:11 2009
;; MSG SIZE rcvd: 107
ifconfig
Trích:
eth0 Link encap:Ethernet HWaddr 00:0C:29:63:AA:57
inet addr:192.168.1.190 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe63:aa57/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4468 errors:0 dropped:0 overruns:0 frame:0
TX packets:2857 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5518350 (5.2 MiB) TX bytes:257403 (251.3 KiB)
Interrupt:169 Base address:0x2000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:234 errors:0 dropped:0 overruns:0 frame:0
TX packets:234 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:20688 (20.2 KiB) TX bytes:20688 (20.2 KiB)
cat /var/log/mesages
Trích:
May 4 06:40:38 server avahi-daemon[2231]: Registering new address record for fe80::20c:29ff:fe63:aa57 on eth0.
May 4 06:40:41 server avahi-daemon[2231]: New relevant interface eth0.IPv4 for mDNS.
May 4 06:40:41 server avahi-daemon[2231]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.1.190.
May 4 06:40:41 server avahi-daemon[2231]: Registering new address record for 192.168.1.190 on eth0.
Không hiểu sao khi dùng nslookup hiển thị Server: 203.162.4.190 thay vì Server: 192.168.1.190 trên eth0
Mình dùng BIND DNS server , tắt firewall, selinux . Domain hoclinux không do mình quản lý nó không tồn tại trên internet, ** server can't find server.hoclinux123.com: NXDOMAIN là lỗi gì, mình sai xót ở đâu, xin giúp mình với.
   
Trả Lời Với Trích Dẫn
Old
  (#2 (permalink))
 
Status: Offline
Posts: 11
Tham gia: Feb 2008
Thần Tượng?: /home/tichuot
Học viên VNLAMP
 
ti chuot's Avatar
Default 04-05-2009, 15:4 04-05-2009

Edit /var/named/chroot/var/named/1.168.192.in-addr.arpa.db
Trích:
$TTL 86400
@ IN SOA hoclinux123.com. root.hoclinux123.com.(
2004031901 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS hoclinux123.com.
190 IN PTR server.hoclinux123.com.
/etc/init.d/named restart
Bạn đã setup thành DNS Server thì trong file resolv.conf sử dụng IP máy DNS Server phân giải được zòi, sử dụng DNS Server bên ngoài tất nhiên phân giải được domain google.com

thay đổi nội dung bởi: ti chuot, 04-05-2009 lúc 15:4 04-05-2009.
  Send a message via Yahoo to ti chuot Send a message via Skype™ to ti chuot 
Trả Lời Với Trích Dẫn
Old
  (#3 (permalink))
 
Status: Offline
Posts: 20
Tham gia: Feb 2008
Junior Member
Default 04-05-2009, 16:4 04-05-2009

Mình edit như bạn hướng dẫn nhưng khi restart named dùng nslookup
nslookup www.hoclinux123.com
Trích:
Server: 127.0.0.1
Address: 127.0.0.1#53

** server can't find www.hoclinux123.com: NXDOMAIN
Vẫn còn lỗi như trên bạn à
   
Trả Lời Với Trích Dẫn
Old
  (#4 (permalink))
 
Status: Offline
Posts: 11
Tham gia: Feb 2008
Thần Tượng?: /home/tichuot
Học viên VNLAMP
 
ti chuot's Avatar
Default 04-05-2009, 16:4 04-05-2009

sac, bạn muốn phân giải cái gì thì phải tạo record phân giải thuận và nghịch thì nó mới hiểu chứ. Bạn đã phân giải nslookup server.hoclinux123.com ok chưa ? Bạn xem trong file /var/named/chroot/var/named/1.168.192.in-addr.arpa.db đã có record
Trích:
190 IN PTR www.hoclinux123.com.
chưa mà đòi phân giải ???
  Send a message via Yahoo to ti chuot Send a message via Skype™ to ti chuot 
Trả Lời Với Trích Dẫn
Old
  (#5 (permalink))
 
Status: Offline
Posts: 20
Tham gia: Feb 2008
Junior Member
Default 04-05-2009, 21:4 04-05-2009

Trong file /var/named/chroot/var/named/1.168.192.in-addr.arpa.db mình thêm record
Trích:
IN NS hoclinux123.com.
190 IN PTR server.hoclinux123.com.
Mình dùng nslookup thì báo lỗi như trên nữa bạn à, mặc dù truy vấn các record như mx, a, soa, ... ok

nslookup server.hoclinux123.com
Trích:
Server: 203.162.4.190
Address: 203.162.4.190#53
** server can't find server.hoclinux123.com: NXDOMAIN

Tại sao server của mình có địa chỉ là : 192.168.1.190 nhưng khi dùng nslookup trên chính máy server thì xuất hiện ip của server lại là IP của ISP 203.162.4.190.

File /etc/resolv.conf của mình
Trích:
search hoclinux123.com
nameserver 192.168.1.190
nameserver 203.162.4.190
   
Trả Lời Với Trích Dẫn
Old
  (#6 (permalink))
 
Status: Offline
Posts: 222
Tham gia: Jan 2008
Senior Member
 
mice's Avatar
Default 05-05-2009, 16:5 05-05-2009

Trích:
Nguyên văn bởi truongan View Post
Trong file /var/named/chroot/var/named/1.168.192.in-addr.arpa.db mình thêm record


Mình dùng nslookup thì báo lỗi như trên nữa bạn à, mặc dù truy vấn các record như mx, a, soa, ... ok

nslookup server.hoclinux123.com


** server can't find server.hoclinux123.com: NXDOMAIN

Tại sao server của mình có địa chỉ là : 192.168.1.190 nhưng khi dùng nslookup trên chính máy server thì xuất hiện ip của server lại là IP của ISP 203.162.4.190.

File /etc/resolv.conf của mình
trong file resolv bạn để 2 DNS server cái đầu tiên là DNS local của bạn nó chưa work dc nên nó query tiếp DNS thứ 2 đó thui
check lại DNS đi nha, mở /var/log/message xem báo lỗi gì ko


mice2503
  Send a message via Yahoo to mice Send a message via Skype™ to mice 
Trả Lời Với Trích Dẫn
Old
  (#7 (permalink))
 
Status: Offline
Posts: 57
Tham gia: Dec 2007
Member
Default 20-05-2009, 18:20 20-05-2009

Trích:
Nguyên văn bởi ti chuot View Post
sac, bạn muốn phân giải cái gì thì phải tạo record phân giải thuận và nghịch thì nó mới hiểu chứ. Bạn đã phân giải nslookup server.hoclinux123.com ok chưa ? Bạn xem trong file /var/named/chroot/var/named/1.168.192.in-addr.arpa.db đã có record chưa mà đòi phân giải ???
Bạn này được cái nói cứ như đúng rùi Người ta đang thắc mắc phân giải record A ko ra mà bạn hỏi người ta có add record PTR chưa
   
Trả Lời Với Trích Dẫn
Old
  (#8 (permalink))
 
Status: Offline
Posts: 1
Tham gia: Apr 2008
Junior Member
Default 27-06-2009, 21:27 27-06-2009

bạn chưa phân biệt được hostname và NS trong file zone data
xem lại cho kỹ nhé bạn.
lỗi này là do zone data khai báo chưa đúng đó
   
Trả Lời Với Trích Dẫn
Trả lời


Ðiều Chỉnh
Xếp Bài

Quyền Sử Dụng Ở Diễn Ðàn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Smilies đang Mở
[IMG] đang Tắt
HTML đang Tắt
Trackbacks are Mở
Pingbacks are Mở
Refbacks are Mở


Múi giờ GMT. Hiện tại là 02:21 21-05-2012.