配置从DNS服务器,有问题.

由 nobody_am 在 07-03-2003 11:56 发表:

配置从DNS服务器,有问题.

实验环境: 两台RH8.0. 其一:IPaddress : 192.168.0.254,其二:ipaddress: 192.168.0.2:

服务器的相关文件:

/etc/named.conf 文件内容:

options {

directory "/var/named";

forwarders { 210.35.88.5; 210.35.99.3; };

//forward only;

//allow-query { 192.168.0/24; };

//allow-transfer { 192.168.0/24; };

};

zone "." {

type hint;

file "named.ca";

};

zone "localhost" {

type master;

file "localhost.zone";

};

zone "0.0.127.in-addr.arpa" {

type master;

file "named.local";

};

zone "example1.com" {

type master;

file "db.example1";

};

zone "0.168.192.in-addr.arpa" {

type master;

file "db.192.168.0.254";

};

/etc/hosts 文件内容:

127.0.0.1 localhost.localdomain localhost

192.168.0.254 server1.andsky.com server1

/etc/resolve 文件内容:

search example1.com

nameserver 192.168.0.254

说明:主DNS服务器可以工作,host www.example1.com能够解析出:192.168.0.254

host station2.exmaple2.com能够解析出:192.168.0.2

从服务器的相关配置文件:

/etc/named.conf 文件内容:

options {

directory "/var/named";

forwarders { 192.168.0.254; };

forward only;

};

zone "." {

type hint;

file "named.ca";

};

zone "localhost" {

type master;

file "localhost.zone";

};

zone "0.0.127.in-addr.arpa" {

type master;

file "named.local";

};

zone "example1.com" {

type slave;

masters { 192.168.0.254; };

file "db.example1-slave";

};

zone "0.168.192.in-addr.arpa" {

type slave;

masters { 192.168.0.254; };

file "db.192.168.0-slave";

};

/etc/hosts 文件内容:

127.0.0.1 localhost localhost.localdomain

/etc/resolv.conf

search example1.com

nameserver 192.168.0.2

说明:当service named restart时,/var/named/ 下,无db.example1-slave和db.192.168.0-slave生成

从/var/log/message中,最后有下列显视:

Jul 3 11:52:05 station2 named[2045]: shutting down: flushing changes

Jul 3 11:52:05 station2 named[2045]: stopping command channel on 127.0.0.1#953

Jul 3 11:52:05 station2 named[2045]: no longer listening on 127.0.0.1#53

Jul 3 11:52:05 station2 named[2045]: no longer listening on 192.168.0.2#53

Jul 3 11:52:05 station2 named[2042]: exiting

Jul 3 11:52:05 station2 named[2087]: starting BIND 9.2.1 -u named

Jul 3 11:52:05 station2 named[2087]: using 1 CPU

Jul 3 11:52:05 station2 named[2090]: loading configuration from '/etc/named.conf'

Jul 3 11:52:05 station2 named[2090]: no IPv6 interfaces found

Jul 3 11:52:05 station2 named[2090]: listening on IPv4 interface lo, 127.0.0.1#53

Jul 3 11:52:05 station2 named[2090]: listening on IPv4 interface eth0, 192.168.0.2#53

Jul 3 11:52:05

Published At
Categories with 服务器类
Tagged with
comments powered by Disqus