How to Fix PowerDNS Slave Replication Error
In this tutorial, you'll learn about How to Fix PowerDNS Slave Replication Error. We cover key concepts, practical examples, and best practices.
PowerDNS slave server fails to replicate zones from the master, showing failed: AXFR not allowed or Timeout waiting for UDP packet — the master is not configured to allow transfers or the notification setup is incomplete.
The Problem
Failed to retrieve zone 'example.com' from master 192.0.2.1:
AXFR not allowed
Step-by-Step Fix
Step 1: Configure master to allow AXFR
# /etc/powerdns/pdns.conf on master
allow-axfr-ips=192.0.2.2 # Slave IP
also-notify=192.0.2.2
master=yes
slave=no
Step 2: Configure slave
# /etc/powerdns/pdns.conf on slave
slave=yes
master=no
superslave=yes # If using auto-provisioning
Step 3: Set up supermaster auto-provisioning
# On slave
superslave=yes
# In database
# INSERT INTO supermasters VALUES ('192.0.2.1', 'ns1.example.com', 'admin');
Step 4: Test zone transfer
# From slave
pdns_control retrieve example.com
Step 5: Check replication status
pdns_control list-zones
Expected:
example.com slave native 2024062401 In sync with master
Step 6: Monitor replication logs
sudo tail -f /var/log/powerdns/pdns.log | grep -i "axfr\|transfer\|slave"
Prevention Tips
- Use TSIG-signed AXFR for secure zone transfers
- Set
also-notifyto notify slaves of zone changes - Monitor zone serial numbers on master vs slave
- Use supermaster for automatic slave provisioning
Common Mistakes with slave replicate
- Non-exhaustive pattern matches that compile with warnings then crash at runtime
- Misunderstanding that
Stringis[Char]with poor performance for large text operations - Using
foldlinstead offoldl'causing stack overflow on large lists
These mistakes appear frequently in real-world POWERDNS code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.
Practice Exercise
Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.
This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.
FAQ
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro