|
|
所用版本:
etchoforstudy:/etc/bind# uname -r
2.6.18-4-686
安装bind9
apt-get install bind9
测试是否工作:
etchoforstudy:/etc/bind# telnet localhost 53
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
^]
telnet> quit
Connection closed.
etchoforstudy:/etc/bind#
以allin.com 作为测试域名,修改 /etc/bind/named.conf 文件,在里面加如下面几行:
zone "0.168.192.in-addr.arpa" {
type master;
file "/etc/bind/arpaallin.com";
};
zone "allin.com" {
type master;
file "/etc/bind/allin.com";
};
其中/etc/bind/allin.com文件为:
etchoforstudy:/etc/bind# cat allin.com
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
allin.com IN SOA allin.com. dns.allin.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
allin.com IN NS dns.allin.com.
@ IN A 127.0.0.1
proxy IN A 192.168.0.1
dns IN A 192.168.0.10
mail IN A 192.168.0.20
misc IN A 192.168.0.30
www IN CNAME misc
ftp IN CNAME mics
mail IN MX 10 mail.allin.com.
/etc/bind/arpaallin.com文件为
etchoforstudy:/etc/bind# cat arpaallin.com
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
allin.com IN SOA allin.com. dns.allin.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
allin.com IN NS dns.allin.com.
1 IN PTR proxy.allin.com.
10 IN PTR dns.allin.com.
20 IN PTR mail.allin.com.
30 IN PTR misc.allin.com.
/etc/resolv.cof 文件内容为:
etchoforstudy:/etc/bind# cat ../resolv.conf
search localdomain
nameserver 192.168.0.10
nameserver 192.168.153.2
修改完文件后重新启动:
etchoforstudy:/etc/bind# /etc/init.d/bind9 restart
Stopping domain name service...: bind.
Starting domain name service...: bind.
etchoforstudy:/etc/bind#
用nslookup测试:
etchoforstudy:/etc/bind# nslookup
> www.allin.com
Server: 192.168.153.2
Address: 192.168.153.2#53
Non-authoritative answer:
Name: www.allin.com
Address: 64.168.92.70
> dns.allin.com
Server: 192.168.153.2
Address: 192.168.153.2#53
** server can't find dns.allin.com: NXDOMAIN
> 192.168.1.10
Server: 192.168.153.2
Address: 192.168.153.2#53
** server can't find 10.1.168.192.in-addr.arpa: NXDOMAIN
>
不能正确解析和反解析地址
看日志文件:
etchoforstudy:/etc/bind# cat /var/log/messages |grep bind
Oct 10 22:54:25 etchoforstudy kernel: TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
Oct 10 22:54:25 etchoforstudy kernel: TCP: Hash tables configured (established 8192 bind 4096)
Oct 10 23:33:58 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 10 23:33:58 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 11 16:26:11 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 11 16:26:11 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 11 10:11:40 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 11 10:11:40 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 11 10:22:19 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 11 10:22:19 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 12 08:51:55 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 12 08:51:55 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 13 09:29:08 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 13 09:29:08 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 13 09:56:32 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 13 09:56:32 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 13 13:43:52 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 13 13:43:52 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 13 17:44:17 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 13 17:44:17 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 14 09:42:55 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 14 09:42:55 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 14 17:36:37 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 14 17:36:37 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 14 17:43:20 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 14 17:43:20 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 14 17:46:00 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 14 17:46:00 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 14 18:56:10 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 14 18:56:10 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 14 18:58:03 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 14 18:58:03 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 14 19:45:58 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 14 19:45:58 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 16 10:49:01 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 16 10:49:01 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 16 18:42:15 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 16 18:42:15 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 17 12:32:21 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 17 12:32:21 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 18 13:07:56 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 18 13:07:56 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 19 13:48:57 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 19 13:48:57 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 29 19:40:15 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 29 19:40:15 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 30 16:30:46 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 30 16:30:46 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 31 12:16:02 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 31 12:16:02 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 31 13:29:20 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 31 13:29:20 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 31 15:36:04 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 31 15:36:04 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Oct 31 17:00:57 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Oct 31 17:00:57 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Nov 2 10:07:28 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Nov 2 10:07:28 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Nov 2 12:54:28 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Nov 2 12:54:28 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Nov 2 13:35:08 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Nov 2 13:35:08 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Nov 2 13:36:58 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Nov 2 13:36:58 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Nov 2 13:38:19 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Nov 2 13:38:19 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Nov 2 13:45:01 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Nov 2 13:45:01 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Nov 5 11:05:34 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Nov 5 11:05:34 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Nov 6 11:54:49 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Nov 6 11:54:49 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Nov 6 15:17:22 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Nov 6 15:17:22 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Nov 6 19:14:21 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Nov 6 19:14:21 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Nov 13 21:02:45 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Nov 13 21:02:45 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Nov 14 11:00:57 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Nov 14 11:00:57 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
Nov 14 11:05:00 etchoforstudy kernel: TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
Nov 14 11:05:00 etchoforstudy kernel: TCP: Hash tables configured (established 4096 bind 2048)
etchoforstudy:/etc/bind#
不明白它说的是什么意思???
翻了好几本说,说的都差不多,但是就是不成功。
请对dns熟悉的朋友帮在下一个忙。在此多谢了。 |
|