分享
 
 
 

从源文件构件bind9域名服务器

王朝厨房·作者佚名  2007-01-02
窄屏简体版  字體: |||超大  

从源文件构件bind9域名服务器

nalan$2003-06-18

1.从http://www.isc.org/products/BIND/bind9.html下载bind9的源文件。目前版本为9 .22,源文件为bind-9.2.2.tar.gz。

2.将源文件bind-9.2.2.tar.gz置于/usr/local/src目录下。

3.解压缩源文件bind-9.2.2.tar.gz

# tar -xzvf bind-9.2.2.tar.gz

4.进入安装目录

# cd bind-9.2.2

5.配置、编译

# ./configure

# make

6.安装

# make install

7.生成的可执行文件位于/usr/local/sbin目录下。最重要的可执行文件为named和rndc。

8.创建链接

# ln -s /usr/local/sbin/rndc /usr/sbin/rndc

# ln -s /usr/local/sbin/named /usr/sbin/named

9.创建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.conf

10.创建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"; };

};

11.创建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 "ycmail.net" IN {

type master;

file "ycmail.net.zone";

allow-update { none; };

};

zone "252.177.61.in-addr.arpa" IN {

type master;

file "named.61.177.252";

allow-update { none; };

};

include "/etc/rndc.key";

12.创建/var/named目录

# mkdir /var/named

# cd /var/named

13.匿名登录到ftp站点FTP.RS.INTERNIC.NET,获取/domain目录下的named.root文件,将该文件置于/var/named目录下。

14.创建localhost文件

# vi localhost

$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

15.创建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.

16.创建ycmail.net.zone文件

# vi ycmail.net.zone

$TTL 86400

@ IN SOA mail.ycmail.net. postmaster.ycmail.net. (

2003061800 ; Serial

28800 ; Refresh

14400 ; Retry

3600000 ; Expire

86400 ) ; Minimum

IN NS mail.ycmail.net.

mail IN A 61.177.252.34

www IN CNAME mail

17.创建named.61.177.252文件

# vi named.61.177.252

$TTL 86400

@ IN SOA mail.ycmail.net. postmaster.ycmail.net. (

2003061800 ; Serial

28800 ; Refresh

14400 ; Retry

3600000 ; Expire

86400 ) ; Minimum

IN NS mail.ycmail.net.

34 IN PTR mail.ycmail.net.

18.创建启动脚本

# vi /etc/rc.d/init.d/named

#!/bin/sh

#

# named This shell script takes care of starting and stopping

# named (BIND DNS server).

#

# chkconfig: 345 55 45

# description: named (BIND) is a Domain Name Server (DNS) \

# that is used to resolve host names to IP addresses.

# probe: true

# Source function library.

. /etc/rc.d/init.d/functions

# Source networking configuration.

. /etc/sysconfig/network

# Check that networking is up.

[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/sbin/named ] || exit 0

[ -f /etc/named.conf ] || exit 0

# See how we were called.

case "$1" in

start)

# Start daemons.

echo -n "Starting named: "

daemon named

echo

touch /var/lock/subsys/named

;;

stop)

# Stop daemons.

echo -n "Shutting down named: "

killproc named

rm -f /var/lock/subsys/named

echo

;;

status)

/usr/sbin/rndc status

exit $?

;;

restart) &nb, sp;

$0 stop

$0 start

exit $?

;;

reload)

/usr/sbin/rndc reload

exit $?

;;

probe)

# named knows how to reload intelligently; we don't want linuxconf

# to offer to restart every time

/usr/sbin/rndc reload >/dev/null 2>&1 || echo start

exit 0

;;

*)

echo "Usage: named {start|stop|status|restart}"

exit 1

esac

exit 0

19.将/etc/rc.d/init.d/named变成可执行文件。

# chmod 755 /etc/rc.d/init.d/named

20.创建启动脚本symbollink

# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc0.d/K45named

# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc1.d/K45named

# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc2.d/K45named

# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc3.d/S55named

# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc4.d/S55named

# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc5.d/S55named

# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc6.d/K45named

21.启动bind9

# /etc/rc.d/init.d/named start

停止bind9

# /etc/rc.d/init.d/named stop

查看状态

# /etc/rc.d/init.d/named status

22.检查配置文件及域文件

# /usr/local/sbin/named-checkconf

# /usr/local/sbin/named-checkzone ycmail.net /var/named/ycmail.net.zone

23.本文档仅仅实现了安装bind9服务器,关于配置文件的高级内容请参阅其他相关文档。

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有