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 -
创建主配置文件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 -
安装文件说明
[root@testdns man8]# tree /etc/named/ -L 2 /var/named/ /usr/local/bind/ /etc/named/ ├── named.conf #主配置文件 /var/named/ #区域配置文件 /usr/local/bind/ ├── bin #工具包 │ ├── dig │ ├── host │ ├── nslookup ├── include #包含的一些包文件 ├── lib #库文件 ├── sbin │ ├── named #主程序 │ ├── named-checkconf #检查配置文件 │ ├── named-checkzone #检查区域配置文件 │ ├── rndc #远程控制工具 │ ├── rndc-confgen #生成/etc/rndc.conf配置文件 ├── share #帮助文档 └── var #运行进程文件 -
启动dns服务测试是否安装成功
named -f -g -d 3 -u named
测试结果