sh /script/fixdns
in SSH shell
yum -y install epel-release yum-plugin-priorities
curl -o /etc/yum.repos.d/powerdns-auth-44.repo https://repo.powerdns.com/repo-files/centos-auth-44.repo
curl -o /etc/yum.repos.d/powerdns-rec-45.repo https://repo.powerdns.com/repo-files/centos-rec-45.repo
yum -y update pdns*
yum -y install pdns-recursor
yum -y install dnsdist
nameserver 127.0.0.1
to your /etc/resolv.conf
file at the beginning:
; generated by /usr/sbin/dhclient-script
nameserver 127.0.0.1
nameserver 1.1.1.1
nameserver 8.8.8.8
nameserver 8.8.4.4
setuid=pdns
setgid=pdns
launch=gmysql
gmysql-dnssec=yes
gmysql-host=127.0.0.1
gmysql-user=powerdns
gmysql-password=somepassword
gmysql-dbname=powerdns
#launch=bind
#bind-config=/etc/named.conf
#bind-check-interval=300
master=no
slave=no
version-string=anonymous
local-port=5300
local-address=127.0.0.1
6. Your /etc/pdns-recursor/recursor.conf should look like this - replace yourdomain.com with your domain name:
local-address=127.0.0.1
allow-from=127.0.0.1
forward-zones=yourdomain.com=127.0.0.1:5300
local-port=5301
setgid=pdns-recursor
setuid=pdns-recursor
version-string=none
setLocal('0.0.0.0')
setACL({'0.0.0.0/0', '::/0'}) -- Allow all IPs access
newServer({address='127.0.0.1:5300', pool='auth'})
newServer({address='127.0.0.1:5301', pool='recursor'})
recursive_ips = newNMG()
-- recursive_ips:addMask('127.0.0.1') -- These network masks are the ones from allow-recursion in the Authoritative Server
recursive_ips:addMask('0.0.0.0/0') -- These network masks are the ones from allow-recursion in the Authoritative Server (from any)
addAction(NetmaskGroupRule(recursive_ips), PoolAction('recursor'))
addAction(AllRule(), PoolAction('auth'))
systemctl restart pdns
systemctl restart pdns-recursor
systemctl restart dnsdist
nslookup google.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: google.com
Address: 172.217.20.174