unbound是一款相对简单的DNS服务软件,相对于bind9的复杂配置,更适合新手搭建DNS服务器使用。
话不多说,下面介绍一下unbound的配置。
截止笔者写这篇文章时,unbound已经更新到1.6.1版本。本例所用环境如下:
linux服务器为:Ubuntu 14.04;
unbound软件版本为:1.6.0。
以下为具体安装过程:
1.安装依赖包:
#CentOS系统:sudo yum -y install gcc openssl-devel expat-devel libevent-devel
#ubuntu系统:sudo apt-get install gcc openssl libssl-dev libexpat1-dev libevent-dev
2.下载unbound软件
#官方下载地址:
3.编译安装./configure --prefix=/usr/local/unbound --with-pthreads --with-libevent --with-ssl
参数说明:--with-pthreads:支持多线程;
--with-libevent:允许使用大的传出端口范围。
--with-ssl:用于生成秘钥文件
4.配置unbound.conf文件server:
verbosity: 1
num-threads: 2 #线程数
interface: 127.0.0.1 #监听地址(一般写本机内网ip)
interface: ::0
port: 53 #端口