首页 > 代码库 > 简单编译bind

简单编译bind

编译之前安装开发环境:Development tools , Server Platform Development , gcc等。

创建named用户及属组

# groupadd -g 53 -r named

# useradd -g named -r -u 53 named

2.从isc.org上下载bind源代码

3.编译安装

# tar xf bind-9.9.5.tar.gz

# cd bind-9.9.5

# ./configure --prefix=/usr/local/bind9 --sysconfdir=/etc/named --disable-ipv6 --disable-chroot enable-threads

# make && make install

1)修改PATH环境变量

wKiom1PiJiDQOy5JAAAKbs5oRIk389.png

2)导出man手册

wKioL1PiJ1eiVu-6AAAXxCYkpoU401.png

3)导出库文件

4.提供配置文件

# vim /etc/named.conf

wKiom1PiJ0qAy0siAAAoWIsWZc4390.png

5.为根及localhost提供区域解析库

(1) named.ca

# dig -t NS . @a.root-servers.net > /var/named/named.ca

wKiom1PiKGWjK8XvAAAFGgbuzHA392.png

wKiom1PiKJfRrxUkAABH6cMYwko419.png

(2) localhost.zone

wKiom1PiKkCBK979AAAQCF-Bag0523.png


(3) 127.0.0.zone

wKioL1PiK2miTUKOAAAQq5fpxFA940.png

修改named.ca  localhost.zone  127.0.0.zone权限及属主属组为named


4、尝试启动缓存名称服务器

# named-checkconfig

# named -g -u named -c /etc/named/named.conf


# named -u named


5、提供rndc

# rndc-confgen -r /dev/urandom > /etc/named/rndc.conf

# chown root:named /etc/named/rndc.conf

# chmod 440 /etc/named/rndc.conf


把rndc.conf中的后半段复制到named.conf中,并启用之;

6提供解析域