- 论坛徽章:
- 0
|
由于前贴有许多大虾提供了很多的方法和建议,因此我又整理了一份。原因是我还未配起来,所以还需要大家的帮助。请过往大虾依据你们的经验帮我看看问题到底出在哪里。不配起来我真不甘心。。。。。。。
为配置一个在公司局域网中可以使用的DNS我做了如下工作:
工作1 : /etc/hosts
127.0.0.1 localhost
10.10.9.75 www loghost
工作2 : /etc/nsswitch.conf
hosts: files dns
工作3 : /etc/resolv.conf
domain test.com
nameserver 10.10.9.75
工作4 : /etc/named.conf
options {
directory "/var/named";
};
zone "." in {
type hint;
file "named.ca";
};
zone "0.0.127.in-addr.arpa" in {
type master;
file "named.local";
allow-update {none;};
};
zone "test.com" in {
type master ;
file "test.com.zone";
};
工作5 :
# more named.ca
; This file holds the information on root name servers needed to
; initialize cache of Internet domain name servers
; (e.g. reference this file in the "cache . <file>;"
; configuration file of BIND domain name servers).
;
; This file is made available by InterNIC registration services
; under anonymous FTP as
; file /domain/named.root
; on server FTP.RS.INTERNIC.NET
; -OR- under Gopher at RS.INTERNIC.NET
; under menu InterNIC Registration Services (NSI)
; submenu InterNIC Registration Archives
; file named.root
;
; last update: Aug 22, 1997
; related version of root zone: 1997082200
;
;
; formerly NS.INTERNIC.NET
;
. 3600000 IN NS A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4
;
; formerly NS1.ISI.EDU
;
. 3600000 NS B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET. 3600000 A 128.9.0.107
;
; formerly C.PSI.NET
;
. 3600000 NS C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12
;
; formerly TERP.UMD.EDU
;
. 3600000 NS D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90
;
; formerly NS.NASA.GOV
;
. 3600000 NS E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10
;
; formerly NS.ISC.ORG
;
. 3600000 NS F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241
;
; formerly NS.NIC.DDN.MIL
;
. 3600000 NS G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4
;
; formerly AOS.ARL.ARMY.MIL
;
. 3600000 NS H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53
;
; formerly NIC.NORDU.NET
;
. 3600000 NS I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17
;
; temporarily housed at NSI (InterNIC)
;
. 3600000 NS J.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET. 3600000 A 198.41.0.10
;
; housed in LINX, operated by RIPE NCC
;
. 3600000 NS K.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129
;
; temporarily housed at ISI (IANA)
;
. 3600000 NS L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET. 3600000 A 198.32.64.12
;
; housed in Japan, operated by WIDE
;
. 3600000 NS M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33
; End of File
#
工作6 : /var/named/named.local
$TTL 86400
@ IN SOA localhost. root.localhost. (
20030104 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.
1 IN PTR localhost.
#
工作7 : /var/named/test.com.zone
$TTL 86400
$ORIGIN www.test.com.
@ IN SOA www.test.com. admin.test.com. (
20040104 ; Serial
10800 ; Refresh
3600 ; Retry
604800 ; Expire
86400 ) ; Mininum
@ IN NS www.test.com.
IN MX mail.test.com.
www IN A 10.10.9.75
mail IN A 10.10.9.75
test.com. IN A 10.10.9.75
工作8 : 启动
# /usr/local/sbin/named -c /etc/named.conf
8.2>; 查看进程是否已经启动
# ps -ef | grep named
root 857 1 0 10:38:57 ? 0:00 /usr/local/sbin/named -c /etc/named.conf
#
(
1>;.
在此之前我已经将 /etc/rc2.d/S72inetsvc 中与in.named 相关的语句注释掉了,并重新reboot
#/usr/bin/pkill -x -u 0 'in.named|inetd'
和
#if [ -f /usr/sbin/in.named -a -f /etc/named.conf ]; then
# echo 'starting internet domain name server.'
# /usr/sbin/in.named &
#fi
证实 :
# ps -ef | grep named
root 335 333 0 11:08:39 pts/2 0:00 grep named
2>;. 并证实 53 端口没有被占用:
# netstat -an | grep 53
#
)
工作9 : 测试
1) 方式1:
# nslookup
*** Can't find server name for address 10.10.9.75: Non-existent host/domain
*** Default servers are not available
1.1)确定使用的是那个nslookup
# which nslookup
/usr/local/bin/nslookup
(修改了PATH变量将 /usr/local/bin 放在了 /usr/sbin 的前面)
2) 方式2 :
由于有大虾说 dig 没有nslookup的缺陷所以我使用dig进行查找:
# dig www.test.com
; <<>;>; DiG 8.3 <<>;>; www.test.com
;; res options: init recurs defnam dnsrch
;; got answer:
;; ->;>;HEADER<<- opcode: QUERY, status: SERVFAIL, id: 4
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUERY SECTION:
;; www.test.com, type = A, class = IN
;; Total query time: 1 msec
;; FROM: www.test.com to SERVER: default -- 10.10.9.75
;; WHEN: Mon Jan 12 10:57:30 2004
;; MSG SIZE sent: 31 rcvd: 31
#
这个表示我配置的DNS已经正常运行了吗????
3)方式3:
在IE的地址栏中键入 : http://10.10.9.75 显示某个已经配置好的Apache的成功页面。但是
在IE的地址栏中键入 : http://www.test.com 却重导向了别的网页 http://www.archiecomics.com/12.html
这说明我配置的dns还是没有起作用。
工作10 : 其它相关信息
1) in.named
# /usr/sbin/in.named -v
in.named BIND 8.2.2-P5 Wed Jan 15 04:35:48 PST 2003
Generic Patch-5.8-January 2003
#
2) named
# /usr/local/sbin/named -v
named 8.3.1-REL Sun May 5 05:40:22 EDT 2002
steve@solaris:/usr2/SOURCES/S8/BIND/src/bin/named
#
问题出在哪里?请过往大虾能不吝赐教!谢谢! |
|