unbound:安装与配置

来源:互联网 发布:js数组map 编辑:程序博客网 时间:2024/05/06 13:59

unbound是一个开源local dns,支持edns-client-subnet(bind不支持edns-client-subnet)。

一、下载

        文件名:unbound-1.4.22.tar.gz

        下载地址:http://unbound.net/download.html

        官网:http://unbound.net/index.html

二、安装

        ./configure

        make; make install

三、安装路径

        安装路径:/usr/local/sbin/unbound

        配置文件:/usr/local/etc/unbound/unbound.conf

四、配置、启动unbound

4.1 添加用户

        groupadd unbound

        useradd -d /var/unbound -m -g unbound -s /bin/false unbound

        mkdir -p /var/unbound/var/run

        chown -R unbound:unbound /var/unbound

4.2 下载named.cache

        cd  /usr/local/etc/unbound

        wget ftp://FTP.INTERNIC.NET/domain/named.cache

4.3 修改配置文件unbound.conf

        interface: 0.0.0.0                                        //可以使用本机任意端口IP响应数据包

        port: 53                                                         //使用53端口响应数据包

        access-control: 192.168.0.0/16 allow    //响应来自192.168.0.0网段的数据包

        chroot: "/usr/local/etc/unbound"

        username: "unbound"

        directory: "/usr/local/etc/unbound"

        pidfile: "/usr/local/etc/unbound/unbound.pid"

        root-hints: "/usr/local/etc/unbound/named.cache"    //从这个文件读取根解析的信息

4.4 启动unbound

        /usr/local/sbin/unbound -c /usr/local/etc/unbound/unbound.conf 

        这样在其他机器上,就可以以unbound作为local dns,使用dig查询了。


参考资料:

        unbound:how to Setup and Install     http://unbound.net/documentation/howto_setup.html

        unbound.conf   http://www.unbound.net/documentation/unbound.conf.html

        使用unbound创建dns服务器:http://blog.csdn.net/force_eagle/article/details/2875204


0 0
原创粉丝点击