linux pdns-recursor服务搭建

安装pdns-recursor

yum -y install epel-release
yum -y install pdns-recursor

配置文件:

#主配置文件内容
[root@study06 ~]#  egrep -v '^#|^$' /etc/pdns-recursor/recursor.conf
setuid=pdns-recursor
setgid=pdns-recursor
auth-zones= localhost=/etc/pdns-recursor/named.localhost,1.0.0.127.in-addr.arpa=/etc/pdns-recursor/named.loopback
config-dir=/etc/pdns-recursor
daemon=yes
etc-hosts-file=/etc/pdns-recursor/dns-hosts.local
export-etc-hosts=on
forward-zones-file=/etc/pdns-recursor/zones.txt
hint-file=/etc/pdns-recursor/named.ca
local-address= 0.0.0.0
lua-dns-script=/etc/pdns-recursor/pdns-recursor-3.x.lua
packetcache-servfail-ttl=0
processes=1
quiet=off
server-down-max-fails=0
threads=24
trace=on
# 局域网内的固定解析
vim /etc/pdns-recursor/dns-hosts.local
192.168.31.1 www.test.com    #指定内网解析格式
#需要转发的解析,DNS上级地址可根据需求更换。
vim /etc/pdns-recursor/zones.txt
# 内举例
+yundunddos.com=219.141.136.10,219.141.140.10, 114.114.114.114
# 外举例
+zaobao.com=8.8.8.8,8.8.4.4,208.67.222.222, 208.67.220.220

#未匹配上,默认
#+.=219.141.136.10,219.141.140.10,119.29.29.29,8.8.8.8,8.8.4.4,208.67.222.222,208.67.220.220
#+.=219.141.136.10,219.141.140.10,119.29.29.29,114.114.114.114,114.114.115.115,8.8.8.8,8.8.4.4,208.67.222.222,208.67.220.220
+.=219.141.136.10,219.141.140.10,119.29.29.29,114.114.114.114,114.114.115.115

tips:带加号开头为递归解析,不带+号开头为迭代解析。

局域网一般以上三个配置文件配置好可满足使用了,至于如下几个配置文件创建空文件占位保证服务可启动即可。

named.ca  named.localhost  named.loopback
posted @ 2020-03-21 22:57  IamJet  阅读(2205)  评论(0编辑  收藏  举报