LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 520|回复: 0

DNS前面虽然有相应帖子但不能改决我的问题

[复制链接]
发表于 2003-4-20 15:15:24 | 显示全部楼层 |阅读模式
初级会员

注册日期: Apr 2003
来自: werwer
发帖数: 8
  求帮助
我的情况如下:帮忙分析一下
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Network:172.16.0.0
Server IP:172.16.0.1
Server Subnet-mask:255.255.0.0
Client IP:172.16.0.1-172.16.0.100
Client Subnet-mask:255.255.0.0
Client getway:172.16.0.2
Client DNS:172.16.0.1
一、准备工作:

1. RedHat linux 7.2光盘一套
2.就是小型局域网
3. 一张网卡
4. 除本机以外的其它机器
二、 RedHat linux 7.2安装:

1.定制安装。
2.软件包选择,下面是我的选择:
Printing Support
Network Support
Dialup Support
SMB:windows file server
WWW:web server
DNSNS name server
Software Development
三、linux网络环境配置

1]下面是我机器刚安装好以后所保留的一些服务:
gpm/iptables/netfs/network/nfs/nfslock/portmap/syslog/xfs/xinetd

2]安装linuxconf,配置网络。
放入光盘1
mount /dev/cdrom /mnt/cdrom
cd /mnt/cdrom/RedHat/RPMS
rpm –ivh linuxconf-1.25r7-3.i386.rpm
请用setup/system services或是chkconfig –levlel 3 linuxconf on将linuxconf设置为系统自启动服务。
netconf选择Host name and IP network devices进行主机名及网络设置:
Host name + domain:ygh
------第一张网卡----------
config mode:Manual
primary name + domain:abc
Ip address:172.16.0.1
Netmask:255.255.0.0
Net device:eth0
Kernel Module:eepro100
I/O port:0xb000
Irq:11

用ping命令测试其连通性,ping 网络上其它机器都能ping通。

四、DNS服务器配置

下面我将服务器172.16.0.1配一个域名www.yghong.com ,ftp.yghong.com 配置的文件:
/etc/named.conf
/etc/resolv.conf
/var/named/named.hosts (本身没有自已copy了再修改保存的)
/var/named/named.local
/var/named/named.0.16.172 (本身没有自已copy了再修改保存的,不知名字取的对不对?)

1]配置/etc/named.conf文件。此文件是dns引导文件,named进程在启动时要读取它。
vi /etc/named.conf
// generated by named-bootconf.pl
options {
directory "/var/named";
// query-source address * port 53;
};

zone "." IN {
type hint;
file "named.ca";
};
//----------------------手工添加如下两节------------------------------
zone "yghong.com" IN {
type master;
file "named.hosts";
};

zone "0.16.172.in-addr.arpa" IN {
type master;
file "named.0.16.172";
};
//------------------------------------------------------------------------------
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
};

include "/etc/rndc.key"; (这个是否要加注释?)

以下的三个文件是DNS数据库文件,具体参数不作详解,请参考相关资料。

2]vi /var/named/named.local

$TTL 86400
@ IN SOA ns.yghong.com. root.ns.yghong.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS ns.yghong.com.

1 IN PTR localhost.

3]vi /var/named/named.hosts
@ IN SOA ns.yghong.com. root.ns.yghong.com. (
2002102000; serial (这里的2002102000是我改的,你本身是2002042302)
28800; refresh
14400; retry
3600000; expire
86400; minimu
)
IN NS ns.yghong.com.
yghong IN A 172.16.0.1
yghong1 IN A 172.16.0.10
www IN CNAME ns.yghong.com.
ftp IN CNAME yghong

4]vi /var/named/named.0.16.172
@ IN SOA ns.yghong.com. root.ns.yghong.com. (
2002102000; serial (这里的2002102000是我改的,你本身是2002042302)
28800; refresh
14400; retry
3600000; expire
86400; minimu
)
IN NS ns.yghong.com.
4 IN PTR ns.yghong.com.


5]编辑/etc/resolv.conf文件
vi /etc/resolv.conf
domain yghong.com
nameserver 172.16.0.1
启动服务:
/etc/rc.d/init.d/named start
chkconfig –level 3 named on #将dns服务设置成系统服务,开机自启动
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
测试:
1) ping www.yghong.com 或 ping ftp.yghong.com
提示unknown host www.yghong.com
2) ping 172.16.0.1 能通

4) nslookup 172.16.0.1
提示:
server: 172.16.0.1
address: 172.16.0.1#53
**server can't find 1.0.16.172.in-addr.arpa:NXDOMAIN
5) nslookup www.yghong.com
提示:
server: 172.16.0.1
address: 172.16.0.1#53
**server can't find www.yghong.com:NXDOMAIN
或提示
::connection timed out;noservers could be reached
>

帮我分析一下,多谢!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表