分类:
2004-12-06 01:00:41
一、 Redhat 9 第一张安装光盘&第二张光盘
rpm –ivh bind-9.2.1-16.i386.rpm
rpm –ivh bind-utils-9.2.1-16.i386.rpm
配置步骤:
/etc/named.conf
/etc/host.conf
/etc/resolv.conf
named.conf是主配置文件首先要在里面定义:
用一台老式PC机来作为单位外网备用DNS服务器,
IP地址为221.5.132.195/24;
DomainName为:wlzx.msft.
Setp1:
修改/etc/named.conf文件内容为:
// generated by named-bootconf.pl
options {
directory "/var/named";
/*
* 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;
};
//
// a caching only nameserver config
//
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
type hint;
file "named.ca";
};
zone "wlzx.msft" IN {
type master;
file "top.wlzx.hosts";
allow-update { none; };
};
zone "132.5.221.in-addr.arpa" IN {
type master;
file "221.5.132.rev";
allow-update { none; };
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
include "/etc/rndc.key";
###########################################################
Setp2:
修改/var/named/wlzx.msft.hosts内容如下:
###########################################################
$TTL 86400
@ IN SOA top.wlzx.msft. root.top.wlzx.msft. (
2004033001 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS top.wlzx.msft.
IN MX 5 domino.wlzx.msft.
lms IN A 221.5.132.200
db2 IN A 221.5.132.201
domino IN A 221.5.132.202
www IN CNAME lms.wlzx.msft.
mail IN CNAME domino.wlzx.msft.
localhost IN A 127.0.0.1
loopback IN CNAME localhost.
###########################################################
Setp3:
修改/var/named/221.5.132.rev文件内容如下:
###########################################################
$TTL 86400
@ IN SOA top.wlzx.msft. root.top.wlzx.msft. (
2004033001 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS top.wlzx.msft.
195 IN PTR top.wlzx.msft.
200 IN PTR lms.wlzx.msft.
201 IN PTR db2.wlzx.msft.
202 IN PTR domino.wlzx.msft.
(本地主机声明数据库无须修改)
###########################################################
Setp4:
host.conf文件:用来控制本地程序转换,常用选项有:
order ;查询顺序比如
Multi;确定主机是否在hosts文件中有记录
Nospoof off/no 防止IP欺骗既查询后匹配对比功能
Alert off/no syslog记录IP欺骗
Trim ;查找先前删除此处定义的域名后再进行查找。
###########################################################
Setp5:
resolv.conf文件:
Domain是定义默认的域名
Search是指定域名搜索表(最多6个)
Nameserver是列出域名服务器的IP地址(最多3个指令)
Options是为解析器定义处理方式,常用的有:
rotate;(打开客户端轮询查询)
nochecknames;(禁止检测被查询的域名是否符合RFC952,尤其是解析带有“_”的域名时。
inet6;(可以使用解析器查询IPV6地址)
修改/etc/resolv.conf文件内容如下:
###########################################################domain wlzx.msft.
nameserver 221.5.132.195
nameserver 221.5.203.99
search top.wlzx.msft wlzx.msft.
options nochecknames rotate
###########################################################
二、配置转发
修改/etc/named.conf
在options (
forwarder { 221.5.203.98;61.128.192.68};
);
注意语法
三、 置惟高速缓存服务器
第二张安装光盘
rpm –ivh caching-nameserver-7.2-7.noarch.rpm
REDHAT9的Bind安装好以后默认的就是按照一个惟高速缓存服务器无须修改配置文件。
四、 常用管理命令
1、启动停止和重新启动BIND进程;service named start/stop/restart
2、查看BIND进程是否启动; pstree | grep named
出现“|-named”既为已经启动
3、重读配置文件;rndc reload
4、查看运行状态;rndc status
5、导出惟高速缓存服务器中缓存的数据;rndc dumpdb
6、查看根区指向区文件; grep –v “;” /var/named/named.ca
应该定期到 下载/domain/named.boot文件对named.ca文件进行更新。