没有合适的资源?快使用搜索试试~ 我知道了~
Ubuntu配置DNS服务器--bind.doc
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 106 浏览量
2022-06-26
09:37:23
上传
评论
收藏 196KB DOC 举报
温馨提示
试读
30页
Ubuntu配置DNS服务器--bind.doc
资源推荐
资源详情
资源评论
Ubuntu 配置 DNS 服务器--bind
3. BIND9 的安装与配置
3.1 bind 简介
BIND (Berkeley Internet Name Domain)是 Domain Name System (DNS) 协议的一个实现,提
供了 DNS 主要功能的开放实现,包括
* 域名服务器 (named)
* DNS 解析库函数
* DNS 服务器运行调试所用的工具
是一款开放源码的 DNS 服务器软件,由美国加州大学 Berkeley 分校开发和维护的,
按照 ISC 的调查报告,BIND 是世界上使用最多最广泛的域名服务系统。不论你的邮件服
务器,WEB 服务器或者其他的 services 如何的安全可靠,DNS 的故障会给你带来用户根本
无法访问这些服务。
BIND,也是我们常说的 named,由于多数网络应用程序使用其功能,所以在很多 BIND 的
弱点及时被发现。主要分为三个版本:
v4
1998 年多数 UNIX 捆绑的是 BIND4,已经被多数厂商抛弃了,除了 OpenBSD 还在使用。
OpenBSD 核心人为 BIND8 过于复杂和不安全,所以继续使用 BIND4。这样一来 BIND8/9
的很多优点都不包括在 v4 中。
v8
就是如今使用最多最广的版本,其详细内容可以参阅 BIND 8+ 域名服务器安全增强
v9
最新版本的 BIND,全部重新写过,免费(但是由商业公司资助),也添加了许多新的功
能(但是安全上也可能有更多的问题)。BIND9 在 2000 年十月份推出,现在稳定版本是
9.3.2。
3.2 软件的相关资源
官方网站: http://www.bind.com/
最新版本: 9.3.2 http://www.isc.org/sw/bind/bind9.3.php#download
帮助文档: http://www.isc.org/sw/bind/
配置文件样例: http://www.bind.com/bind.html
FAQ: http://www.nominum.com/getOpenSourceResource.php?id=6
3.3 配置环境
环境:GNU/Linux Debian/testing Linux 2.6.8-2-386
版本:bind9 9.3.2-2
测试域名:mydebian.org
测试 ip: 192.168.102.47 主域名服务器
192.168.102.48 纯缓存域名服务器
192.168.102.49 辅助域名服务器
192.168.102.49 测试客户机
3.4 配置文件说明
安装 bind9 的命令:
~# aptitude update
~# aptitude install bind9 bind9-host dnsutils
配置文件族:
# ls /etc/bind/ -l
total 44
-rw-r--r-- 1 root root 237 Jan 16 2006 db.0
-rw-r--r-- 1 root root 271 Jan 16 2006 db.127
-rw-r--r-- 1 root root 237 Jan 16 2006 db.255
-rw-r--r-- 1 root root 353 Jan 16 2006 db.empty
-rw-r--r-- 1 root root 256 Jan 16 2006 db.local
-rw-r--r-- 1 root root 1507 Jan 16 2006 db.root
-rw-r--r-- 1 root bind 1611 Jan 16 2006 named.conf
-rw-r--r-- 1 root bind 165 Jan 16 2006 named.conf.local
-rw-r--r-- 1 root bind 672 Jan 16 2006 named.conf.options
-rw-r----- 1 bind bind 77 Aug 4 08:41 rndc.key
-rw-r--r-- 1 root root 1317 Jan 16 2006 zones.rfc1918
配置文件说明:
named.conf
设置一般的 named 参数,指向该服务器使用的域数据库的信息源
named.conf.options
全局选项
db.root
根服务器指向文件, 由 Internet NIC 创建和维护, 无需修改, 但是需要定期更新
db.local
localhost 正向区文件,用于将名字 localhost 转换为本地回送 IP 地址 (127.0.0.1)
db.127
localhost 反向区文件,用于将本地回送 IP 地址(127.0.0.1)转换为名字 localhost
其中,主配置文件/etc/named.conf 的配置语句
命令 用法
acl 定义 IP 地址的访问控制清单
control 定义 ndc 使用的控制通道
include 把其他文件包含到配置文件中
key 定义授权的安全密钥
logging 定义日志写什么,写到哪
opitons 定义全局配置选项和缺省值
server 定义远程服务器的特征
trunsted-keys 为服务器定义 DNSSEC 加密密钥
zone 定义一个区
默认情况下, 内容如下:
include "/etc/bind/named.conf.options";
zone "." {
type hint;
file "/etc/bind/db.root";
};
zone "localhost" {
type master;
file "/etc/bind/db.local";
};
zone "127.in-addr.arpa" {
type master;
file "/etc/bind/db.127";
};
zone "0.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};
zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};
include "/etc/bind/named.conf.local";
其中 type 项的值:
master:表示定义的是主域名服务器
slave :表示定义的是辅助域名服务器
hint:表示是互联网中根域名服务器
在 Debian 环境中,options 语句的配置内容, 被移至 named.conf.options 文件中:
options {
directory "/var/cache/bind";
// 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 and later use an unprivileged
// port by default.
// query-source address * port 53;
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
//可以将下面的注释去掉添加原来的 dns (可加多个)
// forwarders {
// 0.0.0.0;
// };
auth-nxdomain no; # conform to RFC1035
};
3.5 创建主域名服务器
a. 首先, 在在 192.168.102.47 机器上安全 bind9
b. 使用编辑器,比如 vi, 编辑配置文件/etc/bind/named.conf
注:在 ubuntu 中还有一个 /etc/bind/named.conf.local (效果相同)
加入如下内容
zone "mydebian.org" {
type master; //定义此区为主服务器
file "/etc/bind/db.mydebian"; //指定区资源文件的位置
};
zone "102.168.192.in-addr.arpa" {
type master; //定义此区为主服务器
file "/etc/bind/db.192"; //指定区资源文件的位置
};
c. 创建区资源文件:
创建区资源文件/etc/bind/db.mydebian 内容如下
;
; BIND data file for local loopback interface
;
$TTL 604800
$ORIGIN mydebian.org.
@ IN SOA mydebian.org. root.mydebian.org. (
2006080401 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns
@ IN MX 0 mail.mydebian.org.
@ IN A 192.168.102.47
ns IN A 192.168.102.47
剩余29页未读,继续阅读
资源评论
智慧安全方案
- 粉丝: 3600
- 资源: 59万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功