-1

I would like to setup a recursive DNS server with multiple IPs all on the same PowerDNS server. Let's say:

8.8.8.1
8.8.8.2

8.8.8.3
8.8.8.4

I was wondering how I could send different responses based on the IP used by the client.

For example, if the client is sendindg his requests to 8.8.8.1 and 8.8.8.2 the site www.example.com would resolve to 1.1.1.1 otherwise, if the client is using 8.8.8.3 and 8.8.8.4 as his DNS server, the response would be 2.2.2.2.

Would this be possible? Maybe with LUA scripting?

Thanks!

2

In Bind you would do this with ACL and Views.

Powerdns' stance on 'Split-Horizon' or 'Bind Views':

The view we hold is that 'views' make a nameserver needlessly complicated inside. As we aim to keep PowerDNS a simple and secure server, we've decided not to implement views. -Bert

Workaround - You could run multiple instances of powerdns, and use Source Based Policy Routing on IPTables or NAT.

0

2 powerdns servers on separate ports and redir it using iptables.

  • Why would you use iptables? It would make more sense to just bind each of them to port 53 on their respective IP address. – kasperd Jan 14 '16 at 19:33
0

This is easy from Lua, indeed. Alternatively you could run two recursors and distribute traffic between them based on client IP, using dnsdist.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.