Chinaunix首页 | 论坛 | 博客
  • 博客访问: 199269
  • 博文数量: 25
  • 博客积分: 2030
  • 博客等级: 大尉
  • 技术积分: 335
  • 用 户 组: 普通用户
  • 注册时间: 2009-05-05 02:49
文章分类

全部博文(25)

文章存档

2012年(1)

2011年(1)

2010年(2)

2009年(21)

我的朋友

分类:

2009-07-24 03:41:13

先更新下源,root帐号登陆
cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.save
wget
mv CentOS-Base.repo.5 CentOS-Base.repo
 
 
 
[root@localhost bind-9.6.1]# ./configure --prefix=/home/service/dns/bind9.6 --with-openssl=/usr/local/ssl/ --enable-threads --sysconfdir=/etc --localstatedir=/var --with-libxml2
##############################################################################################  
参数说明:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]

这里我设置了 prefix路径,所以指明了他的配置文件named.conf统一放到 /etc中.
--with-libxml2=PATH Build with libxml2 library yes|no|path
这个 主要是考虑 bind的web监控,
##############################################################################################

[root@localhost bind-9.6.1]# vi /etc/named.conf
写入如下配置:
options {
        directory "/var/named";
};
 
zone "." {
        type hint;
        file "named.ca";
};
 
[root@localhost bind-9.6.1]# echo "nameserver 202.96.209.133" > /etc/resolv.conf
[root@localhost bind-9.6.1]# dig -t NS . >> /var/named/named.ca
[root@localhost bind-9.6.1]# /home/service/dns/bind9.6/sbin/named
[root@localhost bind-9.6.1]# tail -20 /var/log/messages
Jul 24 03:18:27 localhost named[18501]: listening on IPv4 interface lo, 127.0.0.1#53
Jul 24 03:18:27 localhost named[18501]: listening on IPv4 interface eth1, 192.168.88.128#53
Jul 24 03:18:27 localhost named[18501]: listening on IPv4 interface eth0, 192.168.1.2#53
Jul 24 03:18:27 localhost named[18501]: automatic empty zone: 0.IN-ADDR.ARPA
Jul 24 03:18:27 localhost named[18501]: automatic empty zone: 127.IN-ADDR.ARPA
Jul 24 03:18:27 localhost named[18501]: automatic empty zone: 254.169.IN-ADDR.ARPA
Jul 24 03:18:27 localhost named[18501]: automatic empty zone: 2.0.192.IN-ADDR.ARPA
Jul 24 03:18:27 localhost named[18501]: automatic empty zone: 255.255.255.255.IN-ADDR.ARPA
Jul 24 03:18:27 localhost named[18501]: automatic empty zone: 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA
Jul 24 03:18:27 localhost named[18501]: automatic empty zone: 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA
Jul 24 03:18:27 localhost named[18501]: automatic empty zone: D.F.IP6.ARPA
Jul 24 03:18:27 localhost named[18501]: automatic empty zone: 8.E.F.IP6.ARPA
Jul 24 03:18:27 localhost named[18501]: automatic empty zone: 9.E.F.IP6.ARPA
Jul 24 03:18:27 localhost named[18501]: automatic empty zone: A.E.F.IP6.ARPA
Jul 24 03:18:27 localhost named[18501]: automatic empty zone: B.E.F.IP6.ARPA
Jul 24 03:18:27 localhost named[18501]: none:0: open: /etc/rndc.key: file not found
Jul 24 03:18:27 localhost named[18501]: couldn't add command channel 127.0.0.1#953: file not found
Jul 24 03:18:27 localhost named[18501]: none:0: open: /etc/rndc.key: file not found
Jul 24 03:18:27 localhost named[18501]: couldn't add command channel ::1#953: file not found
Jul 24 03:18:27 localhost named[18501]: running
发现不能启动,要配置/etc/rndc.key
[root@localhost bind-9.6.1]# /home/service/dns/bind9.6/sbin/rndc-confgen >> /etc/rndc.key
[root@localhost bind-9.6.1]# vi /etc/rndc.key
# Start of rndc.conf
key "rndc-key" {
        algorithm hmac-md5;
        secret "NQPjt+zvtCIlXShaJuDw4A==";
};
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 "NQPjt+zvtCIlXShaJuDw4A==";
# };
#
# controls {
#       inet 127.0.0.1 port 953
#               allow { 127.0.0.1; } keys { "rndc-key"; };
# };
# End of named.conf
 
然后把
key "rndc-key" {
       algorithm hmac-md5;
       secret "NQPjt+zvtCIlXShaJuDw4A==";
 };
 controls {
       inet 127.0.0.1 port 953
               allow { 127.0.0.1; } keys { "rndc-key"; };
 };
放入named.conf就可以了,现在已经能进入互联网各个网站了。以下我们开始进行内部网站域名的管理。
 
最终设置:
$TTL 1d
@       IN      SOA     ns.butting.com. root.butting.com. (
                                        2009080800
                                        3H
                                        1H
                                        1W
                                        1D )
        IN      NS      ns.butting.com.
ns      IN      A       192.168.0.1
        IN      MX  10  mail.butting.com.
mail    IN      A       192.168.0.1
 
阅读(1716) | 评论(0) | 转发(0) |
0

上一篇:postfix

下一篇:源码安装mysql-5.1.37

给主人留下些什么吧!~~