I needed an open source DNS solution at work recently, preferably anything but Bind, and it was suggested I use PowerDNS. I had no experience with it, but I was told it was a good product and fairly easy to setup. On top of the DNS Server itself, I need a local DNS caching agent. At this point I had found PowerDNS’s recursor component, along with information that they could be setup side by side, so I figured I’d give it a shot.
Generally, with new open source software like this, I’d just google something up. But I looked for all sorts of variations of “How to setup powerdns server and recursor together” or “powerdns server recursor side by side” and couldn’t manage to find anything. I’m not sure if the Google-Fu wasn’t with me that evening, or maybe the results were simply too low in the stack, or maybe no one has bothered writing it up… but I had to figure it out myself. It isn’t rocket science, but when it’s 1 in the morning (and you’re still in the office) it is nice to have a guide to get your started.
After some brief futzing, I worked it out and the setup is, as expected, fairly simple. Here is the rough approximation what it will take you to get DNS going:
- apt-get install pdns-server pdns-recursor
- /etc/init.d/pdns-recursor stop (Note: you don’t need to stop pdns server because it isn’t started by default)
- nano /etc/pdns/recursor
- Set “local-port=54” and “forward-zones=mydomain.local=127.0.0.1:54” (Do be sure to change ‘mydomain.local’ to your domain that you’ll be hosting in PowerDNS Server)
- nano /etc/pdns/pdns.conf
- Set “local-port=54” and “launch=” whatever your backend will be (I prefer gmysql)
- Configure the pdns server backend data (be it text files, mysql, ldap, etc)
- /etc/init.d/pdns-recursor start
- nslookup snowulf.com 127.0.0.1 This should work, if it doesn’t, check /var/log/syslog for messages from the recursor
- /etc/init.d/pdns start
- dig mydomain.local @127.0.0.1 -p 54 If this doesn’t work, check /var/log/syslog for messages from pdns
- nslookup mydomain.local 127.0.0.1
At this point in time, you should be good to go. As you can see, the process is quite painless. Using 54 for a DNS server is a little odd, but I’m not using any Xerox Network Systems which normally resides on 54. You could of course move the port for the PowerDNS server to any free port, just make sure pdns-recursor gets updated to know where to look.

Hi Jon,
I have similar requirement but slightly different. I want to achieve following.
1. Have the PDNS Recursor run in non recursive mode.
That means I want recursor to perform the recursive look up only when it cant find the answer in the backend ( I am not sure if the recursor actually is able to talk to backend..if yes then I would like to know how to configure this)..
I do not know how do I configure recursor to act like above.
I tried so many things but could not get it right.
Could you please help me with this?
Thanks.
Regards,
Davis Jira
I’m not much of a PDNS expert. To my knowledge, the only way the Recursor works is: Look up specialized in alternate servers (IE Forward-zones, if some are listed), else fail to default DNS server.
What I’m guessing you want, is to have a LOT of domains in the backend (what forward-zones is for) and not list them all and maybe not all of your zone records are complete. That being said, I have no idea how to go about doing that. I’m guess you need something more advanced than the simple Recursor.