由 xie_rongc 在 04-09-2004 13:23 发表:
RH9下DNS配置的详细过程,错在哪里!!!知道的兄弟不要闪啊!!
为学习RH9下的服务器配置,有如下环境:二台计算机与一个HUB,其中一个计算机安装RH9,另一个为WINDOWS 98
要求:安装RH9的计算机要发挥DNS服务器和WWW服务器的功能。
安装WINDOWS 98的计算机仅作为测试使用。
安装:
首先在机器上安装RH9,未设置网卡,将防火墙设置为无,安装DNS服务器软件包(2个)和WWW服务器软件包。
RH9主机名为:red.rong.com IP地址为192.168.0.10
配置:
1.设置主机名
#hostname red.rong.com
编辑/etc/sysconfig/network文件,修改后为
NETWORKING=yes
HOSTNAME=red.rong.com
编辑/etc/hosts文件,修改后为
127.0.0.1 localhost.localdomain localhost
192.168.0.10 red.rong.com red
2.设置IP
利用GNOME下系统设置的网络,输入IP地址192.168.0.10 子网掩码255.255.255.0
3.编辑/etc/named.conf
在默认文件的最后填加如下内容
zone "rong.com" {
type master;
file "rong.com.hosts";
};
zone "0.168.192.in-addr.arpa" {
type master;
file "192.168.0.rev";
};
4.编辑/var/named/rong.com.hosts
$ttl 1D
@ IN SOA red.rong.com. root.red.rong.com.
(
1053891152
3H
15M
1W
1D )
IN NS red.rong.com.
red IN A 192.168.0.10
www IN CNAME red.rong.com.
5.编辑/var/named/192.168.0.rev
$ttl 1D
@ IN SOA red.rong.com. root.red.rong.com.
(
1053892104
3H
15M
1W
1D )
IN NS red.rong.com.
10 IN PTR red.rong.com.
6.编辑/etc/resolv.conf,文件修改为
nameserver 192.168.0.10
7.启动DNS服务
#service named start
8.测试DNS
#host red.rong.com
Host red.rong.com net found:2(SERVFAIL)
我已经想破头了,还是不知道错在哪里!!!郁闷啊,郁闷!!!
由 7dehao 在 04-09-2004 15:53 发表:
出现这个错误提示:
[root@ent3 named]# service named restart
Stopping named: rndc: connect failed: connection refused
[FAILED]
Starting named: [ OK ]
还有就是53端口没打开,不知道是怎么回事,请大家帮忙!
提问时,请你附上相关硬件的型号或牌子,linux发行版、软件的名称和版本。
提问前,如果有可能的话,你最需要做的就是把出错信息和相关的日志信息贴上来。
当然,我们十分期望你能浏览一下置顶贴里的内容。
由 cszlf 在 04-09-2004 15:58 发表:
看你的配置好像是对的,是不是重新启动一下试试(LINUX一般不用重启的)。有没有配置防火墙,比如安装里默认的防火墙规则,关掉iptables试试。
由 7dehao 在 04-09-2004 16:03 发表:
我在测试中关掉了防火墙,但发现就是53端扣是没有打开,不知道怎么打开,用service named restart也不能打开。
用host -T ent3.test.com测试,显示不能和主机的IP的53端口连接。
提问时,请你附上相关硬件的型号或牌子,linux发行版、软件的名称和版本。
提问前,如果有可能的话,你最需要做的就是把出错信息和相关的日志信息贴上来。
当然,我们十分期望你能浏览一下置顶贴里的内容。
由 cszlf 在 04-09-2004 16:05 发表:
真奇怪啊!!
由 xie_rongc 在 04-09-2004 16:08 发表:
7dehao兄弟
你问的问题,我在哪里见到过restart的问题,是RH9的问题,我记得如果把内核升级一下可以解决。
由 xie_rongc 在 04-09-2004 16:11 发表:
能不能回到我的问题啊!
把/var/log/messages中的信息也公布出来,请大家帮忙!
Apr 9 15:31:11 red named[4114]: starting BIND 9.2.1 -u named
Apr 9 15:31:11 red named[4114]: using 1 CPU
Apr 9 15:31:11 red 4月 9 15:31:11 named: named startup succeeded
Apr 9 15:31:11 red named[4114]: loading configuration from '/etc/named.conf'
Apr 9 15:31:11 red named[4114]: no IPv6 interfaces found
Apr 9 15:31:11 red named[4114]: listening on IPv4 interface lo, 127.0.0.1#53
Apr 9 15:31:11 red named[4114]: listening on IPv4 interface eth0, 192.168.0.10#53
Apr 9 15:31:12 red named[4114]: command channel listening on 127.0.0.1#953
Apr 9 15:31:12 red named[4114]: zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
Apr 9 15:31:12 red named[4114]: dns_rdata_fromtext: 192.168.0.rev:2: near eol: unexpected end of input
Apr 9 15:31:12 red named[4114]: zone 0.168.192.in-addr.arpa/IN: loading master file 192.168.0.rev: unexpected end of input
Apr 9 15:31:12 red named[4114]: dns_rdata_fromtext: rong.com.hosts:2: near eol: unexpected end of input
Apr 9 15:31:12 red named[4114]: zone rong.com/IN: loading master file rong.com.hosts: unexpected end of input
Apr 9 15:31:12 red named[4114]: zone localhost/IN: loaded serial 42
Apr 9 15:31:12 red named[4114]: running
由 cszlf 在 04-09-2004 16:13 发表:
service named stop
service named reload
service named restart
由 7dehao 在 04-09-2004 16:26 发表:
我自己的问题已经解决,原来是我在改写/etc/named.conf文件时把最后一行中的include删掉了第一个i,所以出了问题,在service named named的时候报错显示不能识别"nclude",开始看不懂,现在改过来就好了。
提问时,请你附上相关硬件的型号或牌子,linux发行版、软件的名称和版本。
提问前,如果有可能的话,你最需要做的就是把出错信息和相关的日志信息贴上来。
当然,我们十分期望你能浏览一下置顶贴里的内容。
由 7dehao 在 04-09-2004 16:35 发表:
我把我的配置文件贴上来,看看和你的有什么不一样的地方:
>
> 源码:
>
> * * *
>
>
> >
> [root@ent3 root]# cat /etc/sysconfig/network
> >
> NETWORKING=yes
> >
> HOSTNAME=ent3
> >
> DOMAINNAME=ent3.test.com
> >
> GATEWAY=192.168.8.254
> >
>
> >
> [root@ent3 root]# cat /etc/hosts
> >
> # Do not remove the following line, or various programs
> >
> # that require network functionality will fail.
> >
> 127.0.0.1 ent3 localhost.localdomain localhost
> >
> 192.168.8.10 ent3.test.com ent3
> >
>
> >
> [root@ent3 root]# cat /etc/resolv.conf
> >
> domain ent3.test.com
> >
> nameserver 192.168.8.10
> >
> nameserver 202.96.209.5
> >
> nameserver 202.96.209.133
> >
> nameserver 202.96.209.6
> >
>
> >
> [root@ent3 root]# cat /etc/named.conf
> >
> // generated by named-bootconf.pl
> >
>
> >
> options {
> >
> directory "/var/named";
> >
> /*
> >
> * If there is a firewall between you and nameservers you want
> >
> * to talk to, you might need to uncomment the query-source
> >
> * directive below. Previous versions of BIND always asked
> >
> * questions using port 53, but BIND 8.1 uses an unprivileged
> >
> * port by default.
> >
> */
> >
> // query-source address * port 53;
> >
> };
> >
>
> >
> //
> >
> // a caching only nameserver config
> >
> //
> >
> controls {
> >
> inet 127.0.0.1 allow { localhost; } keys { rndckey; };
> >
> };
> >
> zone "." IN {
> >
> type hint;
> >
> file "named.ca";
> >
> };
> >
>
> >
> zone "localhost" IN {
> >
> type master;
> >
> file "localhost.zone";
> >
> allow-update { none; };
> >
> };
> >
>
> >
> zone "0.0.127.in-addr.arpa" IN {
> >
> type master;
> >
> file "named.local";
> >
> allow-update { none; };
> >
> };
> >
>
> >
> zone "ent3.test.com" {
> >
> type master;
> >
> file "ent3.test.com.zone";
> >
> };
> >
>
> >
> zone "8.168.192.in-addr.arpa" {
> >
> type master;
> >
> file "192.168.8.zone";
> >
> };
> >
>
> >
> include "/etc/rndc.key";
> >
>
> >
> [root@ent3 root]# cat /var/named/ent3.test.com.zone
> >
> $TTL 86400
> >
> @ IN SOA ent3.test.com. root.ent3.test.com. (
> >
> 2004040902 ; Serial
> >
> 28800 ; Refresh
> >
> 14400 ; Retry
> >
> 3600000 ; Expire
> >
> 86400 ) ; Minimum
> >
> IN NS ent3.test.com.
> >
>
> >
> ent3.test.com. IN A 192.168.8.10
> >
>
> >
> [root@ent3 root]# cat /var/named/192.168.8.zone
> >
> $TTL 86400
> >
> @ IN SOA ent3.test.com. root.ent3.test.com. (
> >
> 2004040903 ; Serial
> >
> 28800 ; Refresh
> >
> 14400 ; Retry
> >
> 3600000 ; Expire
> >
> 86400 ) ; Minimum
> >
> IN NS ent3.test.com.
> >
>
> >
> 192.168.8.10 IN PTR ent3.test.com.
> >
>
>
> * * *
#chkconfig --level 3 named on
#service named restart
>
> 源码:
>
> * * *
>
>
> >
> [root@ent3 root]# dig ent3.test.com
> >
>
> >
> ; <<>> DiG 9.2.2 <<>> ent3.test.com
> >
> ;; global options: printcmd
> >
> ;; Got answer:
> >
> ;; ->>HE