计算机技术论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

  • 欢迎访问 计算机技术论坛-电脑迷与初学者的家园!由于论坛管理严格,新注册会员可能遇到各种问题,无法解决的请发邮件 admin@jsjbbs.cn
查看: 3467|回复: 3

linux 中DNS的安装与配置(一)

[复制链接]
发表于 2009-4-24 10:20:38 | 显示全部楼层 |阅读模式
我也是刚接触这东西....觉得这个还不错..所以考过来和大家分享下````


网络中为了区别各个主机,必须为每台主机分配一个惟一的地址,这个地址即称为“IP地址”。但这些
数字难以记忆,所以就采用“域名”的方式来取代这些数字了。 当某台主机要与其他主机通信时,就可
以利用主机名称向DNS服务器查询该主机的IP地址。整个DNS域名系统由以下4个部分组成
1.DNS域名空间
2.资源记录
3.DNS服务器
4.DNS客户端
Linux下架设DNS服务器通常是使用Bind程序来实现的。Bind是Berkeley Internet Name Domain Service
的简写,它是一款实现DNS服务器的开放源码软件。Bind原本是美国DARPA资助伯克里大学(Berkeley)
开设的一个研究生课题,后来经过多年的变化发展,已经成为世界上使用最为广泛的DNS服务器软件,目
前Internet上绝大多数的DNS服务器有都是用Bind来架设的
DNS服务器种类:
1.Master Server 主服务器
2.Slave Server 辅助服务器/从服务器
3.Caching only Server 缓存服务器
4.Forwarder Server 转发服务器
5.Stealth Server 秘密服务器
***********************************************************
DNS BIND区域类型:
***************
类型               描述
master      主DNS区域
slave       从DNS区域,由主DNS区域控制
stub        与从区域类似,但只保存DNS服务器的名字
forward     将任何询问请求转发给其他服务器
hint        根DNSInternet服务器集
**********************************************************
常见的BIND配置语句和选项:
*********************
语句                 描述
/*注释*/            C语言风格的BIND注释
//注释               C++语法风格的BIND注释
#注释                Unix shell和Perl系统风格的BIND注释
Acl             定义IP地址匹配列表
Include         包含一个文件
Key             指明用于识别和授权的密钥信息
Logging         指名服务器日志记录的内容和日志信息的来源
Options         全局服务器的配置选项和其他语句的默认值
Control         声明ndc软件工具使用的控制通道
Server          设置某个服务器的配置参数
trusted-keys    定义预先配置到服务器中,并且信任的DNSSEC密钥
zone            定义一个区域
type            指明一个区域类型
file            指明一个区域文件
directory       指明区域文件目录
forwarders      列出主机请求将要被转发的DNS服务器
masters         列出做为从服务器使用的DNS主服务器主机
allow-transfer  指明允许那台主机接受区域传送的请求
allow-query     指明允许那台主机提出询问
motify          当主区域数据允许改变和更新时,允许主服务器通知从服务器
*********************************************************
资源记录类型:
**************
类型              描述
A       主机地址,映射主机名字到IP
NS      本域授权名字服务器
CNAME   规范的名字,用来注释主机的别名
SOA     授权开始,在域文件中开始DNS条目,为域和其他特征(像点和序号)指定名字服务器
WKS     已知的服务描述
PTR     指针记录,执行逆向域名访问,映射IP地址到主机名
RP      文本字符串,包含有关主机的接点信息
HINFO   主机信息
MINFO   电子信箱或邮件列表信息
MX      邮件交换器,传送到域邮件服务器的远程站点
TXT     文本字符串,通常是主机信息
*********************************************************
一、 安装
[root@localhost ~]# rpm -q bind
[root@localhost /]# cd /media/Fedora\ 8\ i386\ DVD/Packages/
[root@localhost Packages]# find . -name "bind*"
bind-9.5.0-16.a6.fc8.i386.rpm
bind-chroot-9.5.0-16.a6.fc8.i386.rpm
bind-libs-9.5.0-16.a6.fc8.i386.rpm
bind-utils-9.5.0-16.a6.fc8.i386.rpm
BIND程序的虚拟目录是/var/named/chroot/
如:/etc/named.conf其实就是 /var/named/chroot/etc/named.conf
如:/var/named/其真正的路径是/var/named/chroot/ var/named/
[root@localhost Packages]# rpm -ivh bind-libs-9.5.0-16.a6.fc8.i386.rpm
warning: bind-libs-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID
4f2a6fd2
Preparing...         ########################################### [100%]
        package bind-libs-9.5.0-16.a6.fc8 is already installed
[root@localhost Packages]# rpm -ivh util-linux-ng-2.13-3.fc8.i386.rpm
warning: util-linux-ng-2.13-3.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing...          ########################################### [100%]
        package util-linux-ng-2.13-3.fc8 is already installed
[root@localhost Packages]# rpm -ivh bind-9.5.0-16.a6.fc8.i386.rpm
warning: bind-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
error: Failed dependencies:
        libmysqlclient.so.15 is needed by bind-9.5.0-16.a6.fc8.i386
        libmysqlclient.so.15(libmysqlclient_15) is needed by bind-9.5.0-16.a6.fc8.i386
        libodbc.so.1 is needed by bind-9.5.0-16.a6.fc8.i386
        libpq.so.5 is needed by bind-9.5.0-16.a6.fc8.i386
        mysql is needed by bind-9.5.0-16.a6.fc8.i386
        postgresql is needed by bind-9.5.0-16.a6.fc8.i386
        unixODBC is needed by bind-9.5.0-16.a6.fc8.i386
[root@localhost Packages]# rpm -ivh mysql-libs-5.0.45-4.fc8.i386.rpm
warning: mysql-libs-5.0.45-4.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing...         ########################################
### [100%]
   1:mysql-libs     ########################################### [100%]
[root@localhost Packages]# rpm -ivh bind-9.5.0-16.a6.fc8.i386.rpm
warning: bind-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
error: Failed dependencies:
        libodbc.so.1 is needed by bind-9.5.0-16.a6.fc8.i386
        libpq.so.5 is needed by bind-9.5.0-16.a6.fc8.i386
        mysql is needed by bind-9.5.0-16.a6.fc8.i386
        postgresql is needed by bind-9.5.0-16.a6.fc8.i386
        unixODBC is needed by bind-9.5.0-16.a6.fc8.i386
[root@localhost Tuxtools]# rpm -ivh unixODBC-2.2.12-5.fc8.i386.rpm
warning: unixODBC-2.2.12-5.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing...        ########################################### [100%]
   1:unixODBC    ########################################### [100%]
[root@localhost Packages]# rpm -ivh bind-9.5.0-16.a6.fc8.i386.rpm
warning: bind-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
error: Failed dependencies:
        libpq.so.5 is needed by bind-9.5.0-16.a6.fc8.i386
        mysql is needed by bind-9.5.0-16.a6.fc8.i386
        postgresql is needed by bind-9.5.0-16.a6.fc8.i386
[root@localhost Tuxtools]# rpm -ivh postgresql-libs-8.2.7-1.fc8.i386.rpm
warning: postgresql-libs-8.2.7-1.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID
4f2a6fd2
Preparing...         ########################################### [100%]
   1:postgresql-libs  ########################################### [100%]
[root@localhost Packages]# rpm -ivh bind-9.5.0-16.a6.fc8.i386.rpm
warning: bind-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
error: Failed dependencies:
        mysql is needed by bind-9.5.0-16.a6.fc8.i386
        postgresql is needed by bind-9.5.0-16.a6.fc8.i386
[root@localhost Tuxtools]# rpm -ivh postgresql-8.2.7-1.fc8.i386.rpm
warning: postgresql-8.2.7-1.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing...          ########################################### [100%]
   1:postgresql      ########################################### [100%]
[root@localhost Packages]# rpm -ivh bind-9.5.0-16.a6.fc8.i386.rpm
warning: bind-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
error: Failed dependencies:
        mysql is needed by bind-9.5.0-16.a6.fc8.i386
[root@localhost Packages]# rpm -ivh mysql-5.0.45-4.fc8.i386.rpm
warning: mysql-5.0.45-4.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing...          ########################################### [100%]
   1:mysql          ########################################### [100%]
[root@localhost Packages]# rpm -ivh bind-9.5.0-16.a6.fc8.i386.rpm
warning: bind-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing...          ########################################### [100%]
   1:bind           ########################################### [100%]
[root@localhost ~]# rpm -q bind
bind-9.5.0-16.a6.fc8
二、 安装完毕后启动DNS服务器并测试回环
[root@localhost etc]# /etc/rc.d/init.d/named start
启动 named:                                               [确定]
[root@localhost etc]# nslookup
> localhost
Server:         127.0.0.1
Address:        127.0.0.1#53
Name:   localhost
Address: 127.0.0.1
> 127.0.0.1
Server:         127.0.0.1
Address:        127.0.0.1#53
1.0.0.127.in-addr.arpa  name = localhost.
> exit
[root@localhost etc]# /etc/rc.d/init.d/named stop
停止 named:                                               [确定]
发表于 2009-5-2 20:05:37 | 显示全部楼层
收了。多谢,
发表于 2009-5-2 20:06:04 | 显示全部楼层
正好现在要用。
发表于 2009-5-22 00:14:24 | 显示全部楼层
才书学浅,看不懂,不过还是顶哈。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

无图版|手机版|计算机技术论坛 JSJBBS.CN @ 2008-2024 ( 鲁ICP备17021708号 )

技术支持 : 北京康盛新创科技有限责任公司

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