主页 PC知识 网管技术 黑客帝国 安全技术 开放系统 程序设计 搜索 技术论坛

 

相关联接
 
RHU本级分类

技术开发
桌面应用
嵌入技术
问答(FAQ)
基础知识
企业应用&技巧

 
RHU阅读排行
·Linux+SHOUTcast建立网络电台
·Linux系统管理讲义(下):WWW服务器讲解
·Linux系统管理讲义(上):系统升级指南
·Linux下proftpd的安装配置与管理方法
·Linux下管理磁盘存储区从原理到技巧
·Linux下新手装网卡指南
·FreeBSD配置基于ADSL的VPN网关+防火墙
·实例讲解在Linux下安装nvidia显卡驱动
·浅谈Linux优化及安全配置的个人体会
·DNS—bind安装与配置的关键技术揭秘

 
 
RHU最新文章
·Linux Mint 6 ( Felicia ) RC1 发布
·Linux Kernel 最新稳定版2.6.26发布
·Linux应用软件 压缩和解压的工具PeaZip
·Linux操作系统桌面环境GNOME和KDE的切换
·Linux操作系统使用的图片浏览及编辑软件
·介绍Linux操作系统下的几个小游戏模拟器
·Linux系统初学者的常见问题解决集结大全
·Linux程序应用开发环境和工具经验谈
·Linux如何助Windows用户免费转换PDF文件
·桌面应用技巧:Linux控制台下轻松工作

 
 
RHU相关搜索









 
 
RHU广而告之

 
 
>您的位置:首页 -> Linux/Unix-> 桌面应用
DNS—bind安装与配置的关键技术揭秘

作者:RHU-TAC编辑员 来自:RHU网络采集 时间:2005-3-31 双击滚屏 收藏本页 字体:


点击 查看RHU2004全年文章


一.、Bind 简介。

Bind是一款开放源码的DNS服务器软件,Bind由美国加州大学Berkeley分校开发和维护的,全名为Berkeley Internet Name Domain它是目前世界上使用最为广泛的DNS服务器软件,支持各种unix平台和windows平台。本文将介绍它在Red hat Linux 9中最基本的安装和配置。

二.、软件的相关资源。

官方网站: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 一些比较标准的配置文件样例。

三.、软件的安装。

1.安装

由其官方网站中下载其源码软件包bind-9.3.1. tar.gz。接下来我将对安装过程的一些重要步骤,给出其解释:

[root@localhost root]#tar xzvf bind-9.3.1. tar.gz
[root@localhost root]#cd bind-9.3.1
[root@localhost bind-9.3.1]#./configure 
[root@localhost bind-9.3.1]#make
[root@localhost bind-9.3.1]#make install


tar xzvf bind-9.3.1.tar.gz 解压缩软件包。

./configure 针对机器作安装的检查和设置,大部分的工作是由机器自动完成的,但是用户可以通过一些参数来完成一定的设置,其常用选项有:

./configure --help 察看参数设置帮助。

--prefix= 指定软件安装目录(默认/usr/local/)。

--enable-ipv6 支持ipv6。

可以设置的参数很多,可以通过 -help察看需要的,一般情况下,默认设置就可以了。



默认情况下,安装过程是不会建立配置文件和一些默认的域名解析的,不过并不妨碍,可以从下载一些标准的配置文件(http://www.bind.com/bind.html),也可以使用本文所提供的样例文件。



默认情况下,安装的deamon为/usr/local/sbin/named

默认的主配置文件,/etc/named.conf(须手动建立)。



2.启动:

[root@localhost root]# /usr/local/sbin/named -g


/usr/local/sbin/named默认情况是一个后台deamon ,-g选项表示前台运行,并将调试信息打印到标准输出,这在我们安装调试阶段是非常有帮助的。

如果建立了配置文件和域名解析文件(关于怎样建立将在下面的部分讲到),ps aux 应该可以查到named 的进程,或netstat -an 也可以看到53端口的服务已经起来了。(DNS默认端口为53)

如果要设置开机自启动DNS server,只需在/etc/rc.d/rc.local中加入一行

/usr/local/sbin/named

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local

/usr/local/sbin/named
四.软件的配置。

1.主配置文件

默认安装主配置文件的位置为

/etc/named.conf

下面逐步分析一个比较基础的配置文件:(注:named配置文件采用和c语言相同的注释符号)。

(1) log options















/*
 * log option
 */
logging { 
	channel default_syslog { syslog local2; severity error; };
	channel audit_log { file "/var/log/named.log"; severity error; print-time yes; };
	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 "/var/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进行解析。

dump-file "/etc/named_dump.db"; 指定named_dump.db文件的位置。

(3) 线索域和回环域

// Setting up secondaries is way easier and the rough picture for this
// is explained below.
//
// If you enable a local name server, don't forget to enter 127.0.0.1
// into your /etc/resolv.conf so this server will be queried first.
// Also, make sure to enable it in /etc/rc.conf.

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。

[本文共有 2 页,当前是第 1 页] <<上一页 下一页>>

OVER

[1] [2] 页 RedHyphone.Union 投稿邮箱
[特别声明]:
本站文章大多搜索转载自网络中,如果侵犯了您的权利,请告之我们。本站将立即删除。
本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有。
查看评论】【向上滚屏】【关闭窗口】【 打印
-相关文章
  • 认知盲区 解惑双网卡双线路DNS解析
  • FlashFXP 简体中文版 3.7.5 Build 1303 Beta[烈火]
  • 确认:番茄花园作者洪磊被检察院批准逮捕
  • 1983年的今天 DNS诞生
  • Windows 2003 IIS 6.0搭建asp+.net+php+jsp+mysql+mssql
  • -文章评论 (关闭)
    ·还没有相关的评论!

    网上大名:
    红旋风网络技术联盟 RHUTech.Union
     
    Copyright © 2000-2007 RedHyphone.Union All Rights Reserved. 红旋风联盟版权所有.皖ICP备05011033号
    中国红旋风网络技术联盟 | www.RedHyphone.net
    Mailto:Redhyphone@gamil.com