05PdnsRecursor - amagerard/PowerDNS GitHub Wiki
RedHat/Powerdns
1- Network | 2- Pdns | 3- Mariadb | 4- PowerAdmin | 5- PdnsRecursor | 6- Selinux |
---|---|---|---|---|---|
7- GnomeShell | 8-Synoptic | 09-ManageDns | 10-Update |
5. Pdns-recursor.
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.
dnf install pdns-recursor
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.
vi /etc/pdns-recursor/recursor.conf
Please put the redirects of areas managed by their servers.
# forward-zones Zones for which we forward queries, comma separated domain=ip pairs
forward-zones=ol26modk.com=127.0.0.1:8669, 50.168.192.in-addr.arpa=127.0.0.1:8669, 90.168.192.in-addr.arpa=127.0.0.1:8669
## If you have AD domain server.
forward-zones +=dw.learn.lan=192.168.40.47:53
Put the redirection dns server (here 1.1.1.1).
# forward-zones-recurse Zones for which we forward queries with recursion bit, comma
forward-zones-recurse=.=1.1.1.1
Put the IP of the DNS server.
# local-address IP addresses to listen on, separated by spaces or commas.#
local-address=192.168.90.41
Pdns-recursor listening port 53.
# local-port port to listen on
local-port=53
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