PowerDNS Recursor (Ubuntu)

Aus Tutorials
Zur Navigation springen Zur Suche springen

Allgemein

https://www.powerdns.com/recursor.html

Installation

Zuerst den PowerDNS Authoritive Server stoppen, da es sonst zu einer Fehlermeldung beim Starten des Recurser kommt, da bei den beide den Port 53 benutzen:

sudo systemctl stop pdns

Danach den Recurser installieren:

sudo apt-get install -y pdns-recursor

Im Anschluss daran diesen auch gleich wieder stoppen

sudo systemctl stop pdns-recursor.service

und den LoadBalancer dnsdist installieren:

sudo apt-get install -y dnsdist

Um mit der Konfiguration fortfahren zu können, den Service ebenfalls gleich wieder stoppen:

sudo systemctl stop dnsdist.service

Links

https://doc.powerdns.com/recursor/getting-started.html#installation

https://dnsdist.org/install.html

Konfiguration

/etc/powerdns/pdns.conf

sudo vi /etc/powerdns/pdns.conf
local-address=127.0.0.1
local-port=5300

/etc/powerdns/recursor.conf

sudo vi /etc/powerdns/recursor.conf
local-address=127.0.0.1
local-port=5301

forward-zones=example1.com=127.0.0.1:5300
forward-zones+=example2.com=127.0.0.1:5300

Links

https://doc.powerdns.com/recursor/getting-started.html#configuring-the-recursor

https://doc.powerdns.com/recursor/settings.html#forward-zones

/etc/dnsdist/dnsdist.conf

sudo vi /etc/dnsdist/dnsdist.conf
setLocal('127.0.0.1:53')
addLocal('10.0.0.157:53')
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/32') -- These network masks are the ones from allow-recursion in the Authoritative Server
recursive_ips:addMask('10.0.0.0/24') 

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

WAN-Schnittstelle muss ebenfalls mit addLocal() hinzugefügt werden, sonst reagiert der Nameserver nur auf lokale Anfragen.

Links

https://dnsdist.org/dnsdist.pdf

Services starten

sudo systemctl restart pdns.service
sudo systemctl restart pdns-recursor.service
sudo systemctl restart dnsdist.service

Testen

Jetzt sollten die Testabfragen von Datenbank_für_PowerDNS erstellen#Testabfragen weiterhin funktionieren.

Jedoch zusätzlich auch externe Adressen wie z.B.:

pi@server1:~ $ dig +short www.google.com @127.0.0.1
216.239.38.117
216.239.36.117
216.239.32.117
216.239.34.117

Links

https://doc.powerdns.com/authoritative/guides/recursion.html


Zurück zu PowerDNS