dns 重動后,區域網間不能用計算機名ping,
區域網間安裝了一個DNS,配置好name.conf 后。
#vi name.conf
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
type hint;
file "named.ca";
};zone "berwick.com" IN {
type master;
file "weblendar.com.zone";
allow-update { none; };
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "named.weblendar";
allow-update { none; };
};
include "/etc/rndc.key";
然後在/var/named/里新建了weblendar.com.zone named.weblendar文件
weblendar.com.zone
$TTL 86400
@ IN SOA berwick.weblendar.com. root.weblendar.com. (
20060113 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
;
NS berwick
; MX 10 mail
; MX 10 mail.weblendar.com.
;
localhost A 127.0.0.1
; MX 10 mail
gateway A 192.168.1.254
switch A 192.168.1.201
hp1 A 192.168.1.210
.....
named.weblendar
$TTL 3D
@ IN SOA berwick.weblendar.com. root.weblendar.com. (
20060113 ; Serial
8H ; Refresh
2H ; Retry
4W ; Expire
1D) ; Minimum
NS berwick.weblendar.com.
1 PTR berwick.weblendar.com.
21 PTR edinburgh.weblendar.com.
22 PTR bristol.weblendar.com.
........
看啟動named 后區域網間用計算機名不能PING能。
# ping berwick
ping: unknown host berwick
這是怎麼回事。
《解決方案》
看了一下日誌出現下面的錯誤
May 19 16:33:41 localhost named: starting BIND 9.2.4 -u named -t /var/named/chroot
May 19 16:33:41 localhost named: using 1 CPU
May 19 16:33:41 localhost named: named startup succeeded
May 19 16:33:41 localhost named: loading configuration from '/etc/named.conf'
May 19 16:33:41 localhost named: listening on IPv4 interface lo, 127.0.0.1#53
May 19 16:33:41 localhost named: listening on IPv4 interface eth0, 192.168.1.1#53
May 19 16:33:41 localhost named: listening on IPv4 interface eth1, 192.168.1.99#53
May 19 16:33:41 localhost named: listening on IPv4 interface ppp0, 61.170.228.233#53
May 19 16:33:41 localhost named: could not configure root hints from 'named.ca': file not found
May 19 16:33:41 localhost named: loading configuration: file not found
May 19 16:33:41 localhost named: exiting (due to fatal error)
《解決方案》
不是DNS沒有給你做解析,而是你的DNS根本就沒有工作.仔細看看配置文件吧,肯定是配置文件出錯了.
《解決方案》
May 19 16:33:41 localhost named: could not configure root hints from 'named.ca': file not found
May 19 16:33:41 localhost named: loading configuration: file not found
May 19 16:33:41 localhost named: exiting (due to fatal error)
named.ca文件沒有!
berwick的a紀錄沒有!
《解決方案》
配置文件中的域是 zone "berwick.com" IN
而在他的解析文件中
weblendar.com.zone
$TTL 86400
@ IN SOA berwick.weblendar.com.
這句話是說,把berwick.com域授權給berwick.weblendar.com.這台機器