P.s. 本次使用服务器为:CentOS 7.5 ,DNS软件为bind-9.12.3-P1,使用源码安装。
-
下载bind软件包
-
解压
tar -zxvf bind-9.12.3-P1.tar.gz
-
编译安装
./configure --prefix=/usr/local/bind/ --sysconfdir=/etc/named/ --with-dlz-mysql=/usr/local/mysql --with-dlz-postgres=/usr/local/PostgreSQL/9.1 --enable-largefile --enable-threads=no --with-openssl --mandir=/usr/local/bind/share/man make -j 4 make install
-
将bind加入环境变量
[root@testdns bind]# cat /etc/profile.d/bind.sh export PATH=${PATH}:/usr/local/bind/sbin/:/usr/local/bind/bin/
4. 创建主配置文件named.conf和rndc.key
```
rndc-confgen -r /dev/urandom >rndc.conf
head -5 rndc.conf >/etc/named/rndc.key
wget -O /tmp/named.conf http://www.internic.net/domain/named.root
```
5. 启动dns服务测试是否安装成功
`named -f -g -d 3 -u named`
![测试结果](https://img.haomeiwen.com/i1885581/c43776e4f98132ed?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
网友评论