当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > bind9的安装

Unix/Linux
Linux命令Man解释:useradd:帐号建立或更新
Linux 网管 123 --- 第7章. 自订的组态及管理内容 -7.使用 Linuxc
Linux 网管 123 --- 第8章. 备份及回存程序 -1.伺服器备份程序
Linux 网管 123 --- 第8章. 备份及回存程序 -2.伺服器回存程序(tar.
Linux 网管 123 --- 第8章. 备份及回存程序 -3.Cisco 路由器组态备
Linux 网管 123 --- 第9章. 各种杂项管理工作 -1.检查储存空间
Linux 网管 123 --- 第9章. 各种杂项管理工作 -2.管理进程
Linux 网管 123 --- 第9章. 各种杂项管理工作 -3.进程的启动及停止
Linux 网管 123 --- 第9章. 各种杂项管理工作 -4.使用 Cron 及 C
Linux 网管 123 --- 第10章. 升级 Linux 及其他应用软体 -1.使用
Linux 网管 123 --- 1. 前言 2. 简介
Linux 网管 123 --- 第3章. 概观 Linux
Linux 网管 123 --- 第4章. 安装及硬体组态 - 1.建立一张安装磁片
轻轻松松的安装Slackware Linux -- 4.如何在硬碟建置Linux系统
轻轻松松的安装Slackware Linux -- 5.其他非标准安装程序解析
如何重新设定时区
Linux中有没有支援 Solairs x86 的档案系统?有的话要如何mount?
MBR如果被覆盖了怎麽办?
如何使用命令trap来捕捉信号?
如何进行增量备份?

Unix/Linux 中的 bind9的安装


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 158 ::
收藏到网摘: n/a

安装步骤
1.先从 http://www.isc.org/products/BIND/ 下载bind,我下载的是bind-9.3.1.tar.gz2.我下载的文件放在/home/tomcat目录下3.进入目录解压缩#tar -xzfz bind-9.3.1.tar.gz -C /usr/local/src4.进入安装目录 # cd bind-9.3.15.配置、编译 # ./configure # make6.安装 # make install7.生成的可执行文件位于/usr/local/sbin目录下。最重要的可执行文件为named和rndc。8.创建链接 # ln -s /usr/local/sbin/rndc /usr/sbin/rndc # ln -s /usr/local/sbin/named /usr/sbin/named9.创建rndc.conf配置文件。 # /usr/local/sbin/rndc-confgen > /etc/rndc.conf # cat /etc/rndc.conf 输出为: # Start of rndc.conf key "rndc-key" { algorithm hmac-md5; secret "y9xvvfQjdWv9f/Fo7wquBg=="; }; 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 "y9xvvfQjdWv9f/Fo7wquBg=="; # }; # # controls { # inet 127.0.0.1 port 953 # allow { 127.0.0.1; } keys { "rndc-key"; }; # }; # End of named.conf10.创建rndc.key文件。将rndc.conf文件中注释部分拷贝生成如下文件: # vi /etc/rndc.key key "rndc-key" { algorithm hmac-md5; secret "y9xvvfQjdWv9f/Fo7wquBg=="; }; controls { inet 127.0.0.1 port 953 allow { 127.0.0.1; } keys { "rndc-key"; }; }; 检查rndc是否正常工作: #/usr/local/sbin/named -g Jan 11 11:56:45.075 starting BIND 9.2.3 -g Jan 11 11:56:45.076 using 1 CPU Jan 11 11:56:45.079 loading configuration from '/etc/named.conf' ...... #/usr/local/sbin/rndc status11.创建named.conf配置文件。# vi /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 // zone "." IN { type hint; file "named.root"; }; 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; }; }; zone "duanfenglei.com" IN { //新加duanfenglei.com的域 type master; file "duanfenglei.com.zone"; allow-update { none; }; }; zone "9.168.192.in-addr.arpa" IN { //新加域的反向解析 type master; file "named.192.168.9"; allow-update { none; }; }; include "/etc/rndc.key";12.创建/var/named目录 # mkdir /var/named # cd /var/named13.匿名登录到ftp站点FTP.RS.INTERNIC.NET,获取/domain目录下的named.root文件和named.ca文件,将该文件置于/var/named目录下。14.创建localhost.zone文件# vi /var/named/localhost.zone $TTL 86400 $ORIGIN localhost. @ 1D IN SOA @ root ( 42 ; serial (d. adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum 1D IN NS @ 1D IN A 127.0.0.115.创建named.local文件 # vi named.local $TTL 86400 @ IN SOA localhost. root.localhost. ( 1997022700 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum IN NS localhost. 1 IN PTR localhost.[root@linux etc]# mkdir /var/named进入/var/named[root@linux etc]# cd /var/named建立localhost.zone文件[root@linux named]#vi localhost.zone$TTL 86400$ORIGIN localhost.@ 1D IN SOA @ root ( 42 ; serial (d. adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum 1D IN NS @ 1D IN A 127.0.0.1建立named.local文件[root@linux named]#vi named.local$TTL 86400@ IN SOA localhost. root.localhost. ( 1997022700 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 61.177.252 ; Expire 86400 ) ; Minimum IN NS localhost.1 IN PTR localhost.16.创建duanfenglei.com.zone文件 # vi duanfenglei.zone $TTL 1D@ IN SOA duanfenglei.com. root.duanfenglei.com. ( 1053891162 3H 15M 1W 1D ) IN NS duanfenglei.com. IN MX 5 duanfenglei.com.www IN A 192.168.9.917.创建named.192.168.9文件 # vi named.192.168.9 $TTL 86400@ IN SOA duanfenglei.com. root.duanfenglei.com.(20031001;7200;3600;43200;86400);@ IN NS duanfenglei.com.9 IN PTR dns.duanfenglei.com.18.启动#named -c /etc/named.conf &19.测试反向解析是否成功[root@testserver61 named]# host 192.168.9.99.9.168.192.in-addr.arpa domain name pointer dn