码迷,mamicode.com
首页 > 其他好文 > 详细

手动安装编译bind二进制压缩包

时间:2017-07-21 10:30:22      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:bind named

首先在www.isc.org网站中下载bind的源码包。

这里用可视化界面的firefox直接下载

  1. find / -name "bind-*"查找到下载后路径。

  2. tar -xf /PATH/TO/BIND,解压到当前目录中。

  3. 前提是已经安装了Desktop Platform Development Development tools 这样才能编译源码包。

  4.  cd bind-9.10.5-P3/进入解压到的目录。

  5. 执行 ./configure --prefix=/usr/local/bind9 --sysconfdir=/etc/named --disable-ipv6 --disable-chroot --enable-threads --without-openssl

  6. 执行 make 进行编译。

  7. 执行makeinstall 连接操作系统。

  8. 至此已经编译安装结束,下面进入named命令的配置。

  9. 首先想要使用bind软件包的命令,需要把路径写入PATH. vim /etc/profile.d./named.sh

    在里面加入 export PATH=/usr/local/bind9/bin:/usr/local/bind9/sbin:$PATH

  10. . /etc/profile.d/named.sh 重新读取PATH的值。

    以上就可以使用named-checkconfig等命令了。

  11. 因为软件包中有库文件,所以需要导出库文件。vim /etc/ld.so.conf.d/named.conf

    在里面加入/usr/local/bind9/lib

  12. ldconfig -v 读取/etc/ld.so.conf.d/

    一下是ldconfig的描述

    ldconfig creates the necessary links and cache to the most recent

       shared  libraries  found in the directories specified on the com-

       mand line, in the file /etc/ld.so.conf, and in the trusted direc-

       tories  (/lib  and  /usr/lib).  The cache is used by the run-time

       linker, ld.so or ld-linux.so.  ldconfig  checks  the  header  and

       filenames  of  the libraries it encounters when determining which

       versions should have their links updated.

13. 导入头文件的搜索路径

    ln -sv /usr/local/bind9/include  /usr/include/named

14. 为了可以查看named的文档,在/etc/man,config中加入/usr/local/bind9/share/man

    借鉴其他的可以写出

15. 以上已经named的配置已经完成。下面写服务器的配置文件。

16. vim /etc/named/named.conf 注意不同版本的bind这个目录有可能不同。

options {

        directory "/var/named";

        allow-query { any; };

};

zone "." IN {

        type hint;

        file "named.ca";

};

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; };

};

17. 下面写named.ca localhost.zone named.local这三个区域文件。

    首先dig -t NS . @192.168.18.200 > /var/named/named.ca

    其次localhost.zone的内容

    

$TTL 86400

@       IN      SOA     localhost.      admin.localhost. (

                        2017072001

                        1h

                        5m

                        1w

                        1d)

        IN      NS      localhost.

localhost.      IN      A       127.0.0.1

    再次named.local

$TTL 86400

@       IN      SOA     localhost.      admin.localhost. (

                        2017072001

                        1h

                        5m

                        1w

                        1d)

        IN      NS      localhost.

1      IN      PTR      localhost.

18. 启动named。

     named -u named -f -g -d 3

19. 到此完成所有配置安装。


本文出自 “别总差一点” 博客,转载请与作者联系!

手动安装编译bind二进制压缩包

标签:bind named

原文地址:http://ji123.blog.51cto.com/11333309/1949593

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!