In my opinion, PowerDNS gives more flexibility to a system administrator to deal with their DNS zones. Things such as having different backends, and mixing dynamic and static answers are hard to archive with bind. In this post, I will write about how to put a Bind-like zone into PowerDNS. This will open possibilities to have some very cool features such as High Availability and Load Balancing through DNS protocol.
Configure your Domain
This is one I use, you will find it is pretty simple. And almost identical to a normal BIND zone.
$TTL 180
@ IN SOA ns1.inside-out.xyz. postmaster.inside-out.xyz. (
2014080704 ; Serial Number (date YYYYMMDD++)
86400 ; Refresh (24 hours)
1800 ; Retry (1/2 hour)
3600000 ; Expire (42 days)
21600) ; Minimum (6 hours)
IN NS ns1.inside-out.xyz.
IN NS ns2.inside-out.xyz.
@ IN A 192.168.0.1
IN MX 10 mail.inside-out.xyz.
IN MX 12 mail2.inside-out.xyz.
IN TXT "v=spf1 a mx ~all"
www IN CNAME inside-out.xyz.
mail IN CNAME mail.okay.com.mx.
ns1 IN A 8.8.8.8
ns2 IN A 8.8.4.4
host1 IN A 192.168.7.1
host2 IN A 192.168.7.2
Some important fields are:
- The SOA line, ns1.inside-out.xyz is the first DNS server, regardless if you have more than one.
- The SOA line, postmaster.inside-out.xyzp comes from the email
This email address is being protected from spambots. You need JavaScript enabled to view it. . You substitute the @ with a dot. It is the system administrator's email. - The NS lines, ns1 and ns2 are the domain servers. The order is not important.
- The MX lines, mail and amil2 specify the servers where the email will arrive.
- If you end a fqdn with a dot, it means it is the absolute name. Otherwise, the domain server will add the current domain name to it.
Save this file on your server, you will need it in the following steps. I will put it in /etc/pdns/inside-out.xyz as a reference in this example.
Next is to create a manifesto file, just like you were using Bind. In my case, I created like this:
zone "inside-out.xyz" { type master; file "/etc/pdns/inside-out.xyz"; };
Save this file, for example at /etc/pdns/bind.conf
Tell PowerDNS to use your Bind Zone
You need to edit your pdns.conf file, edit or add the following lines:
launch=bind
bind-config=/etc/pdns/bind.conf
bind-check-interval=300
Important notes are:
- launch tells us to use the bind backend
- bind-config tells where the manifesto is
- bind-check-interval tells you to check the zones every 300 seconds, if you make a change you don't need to restart PowerDNS, you just wait for the next refresh
If you need more control, you can read the full list of PowerDNS Bind backend parameters documentation.
Good Luck!