|
|
 |
|
|
| 1. nat和dns的一个问题 |
  |
|
 |
|
HP : 0 / 265
MP : 52 / 3932
EXP : 62%
|
|
武林奇才
         
成员等级: 11
发表总数: 158
金币总数: 310
所属组别: 普通成员
注册日期: 2003/12/17

|
我在工程中也遇到了同样的问题
(DMZ放服务器ftp/www/dns----全为私网地地址) 外网---(点对点公网IP)ROUTER(nat)-------(私网IP)---防火墙(做ACL)------(私网IP)---核心交换机(多个VLAN,每个VLAN都有一个部门的WWW服务器也为私有IP。
但目前只申请了一个域名,并且学校只给一个服务器做DNS,要求外网能访问内网各个服务器,同时内网也能访问外网和内网服务器。
不知WINDOWS DNS能否完成这个功能。大家是如何解决的 |
 |
|
|
| 2. Re:nat和dns的一个问题 |
  |
|
 |
|
HP : 0 / 265
MP : 52 / 3932
EXP : 62%
|
|
武林奇才
         
成员等级: 11
发表总数: 158
金币总数: 310
所属组别: 普通成员
注册日期: 2003/12/17

|
就没有一个人知道吗? |
 |
|
|
| 3. Re:nat和dns的一个问题 |
  |
|
 |
|
HP : 1030 / 1717
MP : 4151 / 30220
EXP : 68%
|
|
rotartsinimdA
           
成员等级: 69
发表总数: 12453
金币总数: 456
所属组别: 管理员
注册日期: 2003/01/1

|
bind for windows

 xxbin@netbuddy.org |
 |
|
|
| 4. Re:nat和dns的一个问题 |
  |
|
 |
|
HP : 0 / 265
MP : 52 / 3932
EXP : 62%
|
|
武林奇才
         
成员等级: 11
发表总数: 158
金币总数: 310
所属组别: 普通成员
注册日期: 2003/12/17

|
关键是不知该怎么配置? 我看到了一片这样的文章(原作者的我只是转贴),但是不是太懂 BIND 在win 2000 下的安装及配置
BIND 在win 2000 下的安装及配置 一.、Bind 简介。
Bind是一款开放源码的DNS服务器软件,Bind由美国加州大学Berkeley分校开发和维护的,全名为Berkeley Internet Name Domain它是目前世界上使用最为广泛的DNS服务器软件,支持各种unix平台和windows平台。本文将介绍它在win 2000 server中最基本的安装和配置。
二.、软件的相关资源及准备工作。
官方网站:http://www.bind.com/ 源码软件包:Bind 是开源的软件,可以去其官方网站下载。http://www.isc.org/index.pl/sw/bind/ ,目前最新版本为bind-9.3.1。 帮助文档:http://www.isc.org/index.pl/sw/bind/ 有该软件比较全面的帮助文档。 FAQ:http://www.isc.org/index.pl/sw/bind/ 回答了该软件的常见问题。 配置文件样例:http://www.bind.com/bind.html 一些比较标准的配置文件样例。 下载 UltraEdit 因为要修改配置文件,都需要该软件 ,当然你用记事本也行,提醒你的是用记事本很容易出问题 三.、软件的安装。
1. 安装 由其官方网站中下载其源码软件包bind-9.3.1. tar.gz。接下来我将对安装过程的一些重要步骤,给出其解释: 2. 解压压缩包,运行安装文件setup 3. 默认情况下,安装过程是不会建立配置文件和一些默认的域名解析的,不过并不妨碍,可以从下载一些标准的配置文件(http://www.bind.com/bind.html),也可以使用本文所提供的样例文件。 默认情况下,安装路径为C: \winnt\system32\dns 下,可以看到有两个目录,分别为bin和etc, 默认的主配置文件 \etc\named.conf(须手动修改该文件)。
四.软件的配置。 1 BIND比较重要的配置文件有:named.conf,named.root,rndc.conf,还有\ etc\named目录。 (这几个文件从哪儿可以找到) 2 下面逐步分析一个比较基础的配置文件named.conf:(注:named配置文件采用和c语言相同的注释符号程序能否正常运行,全靠这个文件)。 (1) log options /* * log option */ logging { channel default_syslog { syslog local2; severity error; }; channel audit_log { file "..\log\named.log"; severity error; print-time yes; }; /*手动建立该目录和文件,并修改该路径,注意2000 里路径的符号和unix下路径的写法不同,以后程序中如果读取文件,都要注意路径的写法。*/ category default { default_syslog; }; category general { default_syslog; }; category security { audit_log; default_syslog; }; category config { default_syslog; }; category resolver { audit_log; }; category xfer-in { audit_log; }; category xfer-out { audit_log; }; category notify { audit_log; }; category client { audit_log; }; category network { audit_log; }; category update { audit_log; }; category queries { audit_log; }; category lame-servers { audit_log; }; };
这一部分是日志的设置,其中最主要的是
file "..\log\named.log"; 这一句指定了日志文件的位置,要正常启动named,必须要保证这一文件是存在的,并且named 进程对它有读写权限。
(2) options
options { directory “..\etc\namedb"; /* 注意写法 修改该路径 listen-on-v6 { any; };
// If you've got a DNS server around at your upstream provider, enter // its IP address here, and enable the line below. This will make you // benefit from its cache, thus reduce overall DNS traffic in the Internet.
forwarders { your.upper.DNS.address; };
/* * 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;
/* * If running in a sandbox, you may have to specify a different * location for the dumpfile. */ dump-file "/etc/named_dump.db"; };
这一部分是一些基本的配置项:
directory ".\etc\namedb "; 指定域名解析等文件的存放目录(须手动建立);
listen-on-v6 { any; }; 支持ipv6的请求; forwarders { your.upper.DNS.address; }; 指定前向DNS,当本机无法解析的域名,就会被转发至前向DNS进行解析。
(3) 线索域和回环域 (不知这个是做什么用的)
zone "." { type hint; file "named.root"; };
zone "0.0.127.IN-ADDR.ARPA" { type master; file "localhost.rev"; };
指定线索域和本地回环域,这一部分使用一些标准的例子就可以。
file "named.root"; 指定该域的解析文件,其目录为options中directory "\etc\namedb";指定的。在本例中为\etc\namdb。
4)自定义域
zone "test.com" { type master; file "zone.test "; };
zone "0.168.192.in-addr.arpa" { type master; file "zone. test.rev"; }; zone "4.0.0.f.0.5.2.0.1.0.0.2.IP6.ARPA" { type master; allow-transfer { any;}; allow-query { any; }; file "ipv6.rev"; };
zone "lowerlevelzone.test.com" { type slave; masters { 192.168.1.1; }; };
这一部分是配置文件中我们需要重点关心的部分:
zone "test.com" { type master; file "zone.test "; }; 设定test.com域; type master 指明该域主要由本机解析; file "zone.test "指定其解析文件为zong.test,目录为options中设定的目录本例中为\etc\named。
zone "0.168.192.in-addr.arpa" { type master; file "zone. test.rev"; }; 指定ipv4地址逆向解析
type slave 指明该域主要由低一级的域名服务器解析; masters { 192.168.1.1; };
// 指定低一级的域名服务器ip地址。
到此我们就初步建立了一个标准的named 的主配置文件,接下来建立对应的域名解析或逆向解析文件。
3 域名解析和IP地址逆向解析文件:\etc\namedb\zone.test
配置文件的格式大致如下
; From: @(#)localhost.rev 5.1 (Berkeley) 6/30/90 ; $FreeBSD: src/etc/namedb/PROTO.localhost.rev,v 1.6 2000/01/10 15:31:40 peter Exp $ ; ; This file is automatically edited by the `make-localhost' script in ; the \etc\namedb directory. ; @ IN SOA ns.test.com. root.test.com.( 2005030116; Serial 3600 ; Refresh 900 ; Retry 3600000 ; Expire 3600 ) ; Minimum IN NS ns.test.com
ns IN A 192.168.0.1 www6 IN AAAA 2001:250:f004::10 www IN A 192.168.0.2
本文件前半部分是一些默认的参数设置,只需把域名改成对应得你要设置的域就行,其余的不用过分深究..几个参数稍做解释。
几个需要注意的地方 IN NS ns.test.com; 这一条必须有,来指定本域的域名服务器 ; 域名必须以"."结尾。) 本文件的第二部分(倒数三行),指定了该域上的主机: ns IN A 192.168.0.1 ns 为主机名,A 代表地址类型为IPV4地址,192.168.0.1 是实际ip地址,这一条记录的含义是ns.test.com 的ip地址为 192.168.0.1 www6 IN AAAA 2001:250:f004::10 www6 为主机名,AAAA代表地址类型为IPV6地址,2001:250:f004::10 是其IPV6地址,这条记录的含义是www6.test.com 的ip地址是2001:250:f004::10 。
2)IP地址逆向解析:
ipv4 逆向解析: etc\namedb\zone.test.rev
; From: @(#)localhost.rev 5.1 (Berkeley) 6/30/90 ; $FreeBSD: src/etc/namedb/PROTO.localhost.rev,v 1.6 2000/01/10 15:31:40 peter Exp $ ; ; This file is automatically edited by the `make-localhost' script in ; the \etc/namedb directory. ; @ IN SOA ns.test.com. root.test.com.( 2005030116; Serial 3600 ; Refresh 900 ; Retry 3600000 ; Expire 3600 ) ; Minimum IN NS ns.test.com ;
1 IN PTR ns.test.com. 2 IN PTR www.test.com./
五 几个配置文件到此基本配置完成,成功了一半,接下来通过cmd 进入bin 的目录 运行 1 运行 rndc-confgen –a 生成一个 rndc.key 为什么这么做请看下面这段话,这是BIND安装文件的说明。
which will create a rndc.key file in the dns\etc directory. This will allow you to run rndc without an explicit rndc.conf file or key and control entry in named.conf file. See section 3.4.1.2 of the ARM for details of this. An rndc.conf can also be generated by running:
2 运行 rndc-confgen > rndc.conf
然后你会发现,当前目录有一个rndc.conf的密钥文件了,呵呵,如果你想看一下内容,也可以使用UltraEdit 打开它,该文件内容大致如下:
# Start of rndc.conf key "rndc-key" { algorithm hmac-md5; secret "o2iuzvKIljrrxw7A4cJITQ=="; };
options { default-key "rndc-key"; default-server 127.0.0.1; default-port 953; }; # End of rndc.conf
# Use with the following in named.conf, adjusting the allow list as needed: # key "rndc-key" { # algorithm hmac-md5; # secret "o2iuzvKIljrrxw7A4cJITQ=="; # }; # # controls { # inet 127.0.0.1 port 953 # allow { 127.0.0.1; } keys { "rndc-key"; }; # }; # End of named.conf
注意,请把后面以:
# Use with the following in named.conf, adjusting the allow list as needed:
开始的这一部份,加到named.conf后面并去掉#才可以,否则后面的rndc status将显示超时退出...
六 测试 嗯,到此为止,好象BIND 9就可以顺利运行了,请按下面的步骤测试吧
进入dos 进入到 bin 目录 named -g -c ..\etc\named.conf &
& 的作用是在后台运行
-c的作用是以指定的配置文件运行
,-g选项表示前台运行,并将调试信息打印到标准输出,这在我们安装调试阶段是非常有帮助的。
当你有看到running字样时,说明已经配置正确了,如果要控制BIND 9的运行,更方便的使用rndc命令来进行,
再开一个dos 窗口,进入到bin 目录 运行 rndc status 当显示如下信息时,可能会显示如下信息…
number of zones: 5 debug level: 0 xfers running: 0 xfers deferred: 0 soa queries in progress: 0 query logging is OFF server is up and running
如果看见了 恭喜你 呵呵 ,终于正常配置成功 。如果没有显示上面的信息,请检查你的named.conf文件里面是否配置了rndc.conf里面的key。
至此为止,一般可以实际运作的BIND 9就建立起来了,您可以rndc rolead一下,让最新的设置及软件生效。 如果在安装过程中出现错误,您可以先检查完错误,再接着安装下去。或者你可以选择你感兴趣的某些部份安装! 当然因为时间仓促,涉及到的知识太广,加上本人能力有限,其中错误在所难免,恳请各位读者提出来,大家共同提高,共同进步! 声明:本篇文章好多内容和写法都是从网上借鉴而来的,只是加上自己在2000下的配置,稍做修改,若有版权问题,请与我联系 谢谢 !
named -g -c c:\winnt\system\dns\etc\named.conf
|
 |
|
|
| 5. Re:nat和dns的一个问题 |
  |
|
 |
|
HP : 1030 / 1717
MP : 4151 / 30220
EXP : 68%
|
|
rotartsinimdA
           
成员等级: 69
发表总数: 12453
金币总数: 456
所属组别: 管理员
注册日期: 2003/01/1

|
bind的配置是UNIX的服务中比较简单的了 自己看资料吧
UNIX论坛也有一些相关的

 xxbin@netbuddy.org |
 |
|
|
| 6. Re:nat和dns的一个问题 |
  |
|
 |
|
HP : 92 / 925
MP : 718 / 16280
EXP : 3%
|
|
名动江湖
           
成员等级: 38
发表总数: 2154
金币总数: 201
所属组别: 核心成员
注册日期: 2003/01/3

|
xx得对, 自己去试试吧.多实验,多搜索 |
 |
 |