Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2021-10-23, 22:13:47

Author Topic: How to configure pdns+pdns-recursor+dnsdist  (Read 678 times)

0 Members and 1 Guest are viewing this topic.

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,051
  • Karma: +1/-0
    • View Profile
How to configure pdns+pdns-recursor+dnsdist
« on: 2021-06-12, 22:12:32 »
1. Make sure to have pdns server selected in Kloxo -> Switch Program -> DNS -> pdns from the list

2. Run
Code: [Select]
sh /script/fixdns in SSH shell

3. Type in SSH shell:

Code: [Select]
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

3. Add a line
Code: [Select]
nameserver 127.0.0.1 to your /etc/resolv.conf file at the beginning:

Code: [Select]
; 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

4. Your /etc/pdns/pdns.conf should look like this:

Code: [Select]
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

5. Your /etc/pdns-recursor/recursor.conf should look like this - replace yourdomain.com with your domain name:

Code: [Select]
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

6. Your /etc/dnsdist/dnsdist.conf file should look like this:

Code: [Select]
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

addAction(NetmaskGroupRule(recursive_ips), PoolAction('recursor'))
addAction(AllRule(), PoolAction('auth'))

7. Restart everything:

Code: [Select]
service pdns restart
service pdns-recursor restart
service dnsdist restart

8. Check if your local or Internet domains are working well from your local DNS server:

Code: [Select]
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

9. Verify if DNS server is working fine on https://intodns.com/

Done !
« Last Edit: 2021-07-10, 18:31:19 by Spacedust »

 


Top 4 Global Search Engines:    Google    Bing    Baidu    Yahoo
Click Here

Page created in 0.028 seconds with 18 queries.

web stats analysis