105PdnsRecursor - amagerard/PowerDNS GitHub Wiki
RedHat10/Powerdns
| 1- Network | 2- Pdns | 3- Mariadb | 4- PowerAdmin | 5- PdnsRecursor | 6- Selinux |
|---|---|---|---|---|---|
| 7- GnomeShell | 8-Synoptic | 09-ManageDns | 10-Troubleshoots |
5. Pdns-recursor.
Warning
Wednesday, September 24, pdns-recursor does not exist in the epel 10 repositories.
I use the version 5.3.
5.1 Principle.
Pdns does not allow redirection for other domains.
I am using pdns-recursor to do the redirect.
Operation:
Pdns-recursor responds to all dns requests on port 53.
If these requests concern the ol26modk.com domain , pdns-recursor redirects these requests on port 8669 to pdns.
For other domains pdns-recursor redirects these requests to another dns server.
5.2 Installation.
Download pdns-recursor-5.
cd /tmp
wget https://repo.powerdns.com/centos/x86_64/10/rec-53/pdns-recursor-5.3.0-1pdns.el10.x86_64.rpm
Install dependencies.
dnf install boost-context boost-filesystem net-snmp-agent-libs
Install the package.
rpm -ivh pdns-recursor-5.3.0-1pdns.el10.x86_64.rpm
5.3 Pdns.
Pdns configuration to listen on port 8669.
vi /etc/pdns/pdns.conf
# local-address Local IP addresses to which we bind
local-address=0.0.0.0
# local-port The port on which we listen
local-port=8669
systemctl restart pdns
systemctl enable --now pdns-recursor
5.4 Pdns-recursor.
Warning
The configuration file has changed.
It is in the form of yaml.
It is possible to convert an old recursor.conf configuration file with the command "rec_control show-yaml recursor.conf".
mv /etc/pdns-recursor/recursor.conf /etc/pdns-recursor/recursor.conf_ori
vi /etc/pdns-recursor/recursor.conf
incoming:
# local-address IP addresses to listen on
listen:
- 192.168.90.41
# local-port port to listen on
port: 53
recursor:
# forward-zones for ol26modk.com.
# pdns listen to 8669
forward_zones:
- zone: ol26modk.com
recurse: false
forwarders:
- 127.0.0.1:8669
# Forward-zones for reverse-zones
# pdns listen to 8669
- zone: 40.168.192.in-addr.arpa
recurse: false
forwarders:
- 127.0.0.1:8669
- zone: 50.168.192.in-addr.arpa
recurse: false
forwarders:
- 127.0.0.1:8669
- zone: 60.168.192.in-addr.arpa
recurse: false
forwarders:
- 127.0.0.1:8669
- zone: 70.168.192.in-addr.arpa
recurse: false
forwarders:
- 127.0.0.1:8669
- zone: 80.168.192.in-addr.arpa
recurse: false
forwarders:
- 127.0.0.1:8669
- zone: 90.168.192.in-addr.arpa
recurse: false
forwarders:
- 127.0.0.1:8669
# If you have AD domain server.
# Ip ad server is 192.168.40.47:53
- zone: dw.learn.lan
recurse: false
forwarders:
- 192.168.40.47:53
# forward-zones-recurse Zones .
# By default, anything not listed above is returned as another DNS server.
forward_zones_recurse:
- zone: .
recurse: true
forwarders:
- 1.1.1.1
# This is the default on older versions of pdns-recursor.
security_poll_suffix: ''
setgid: pdns-recursor
setuid: pdns-recursor
# Validation result: OK
# End of converted recursor.conf
# This configuration was converted from the recursor.conf file in pdns-recursor 4.8.9.
# The script is :
# rec_control show-yaml recursor.conf
systemctl restart pdns-recursor
5.5 Network.
Put the ip of your DNS server.
nmcli con mod eth0 ipv4.dns 192.168.90.41
systemctl restart NetworkManager
cat /etc/resolv.conf
search ol26modk.com
nameserver 192.168.90.41
5.6 Check your dns server.
nslookup dns1
nslookup dns1.ol26modk.com
nslookup google.fr