Custom Upstream DNS Servers - PowerDNS

Hello,

in addition to pihole, I want to use powerdns as an addition DNS Server for my network.
Pi-Hole is already running on 192.168.4.2 and deployed into my network.
Powerdns is running on 192.168.4.10
To get this working, I have added the 192.168.4.10 to the Custom 1 (IPv4) Upstream DNS Servers.

My understanding is that pihole forwards unknown requests to all upstream servers, so 192.168.4.10 should respond. or am I wrong?
Because it's not working.

If i ask the powerdns directly it's working,
nslookup test.mytestdomain.local 192.168.4.10
Server: 192.168.4.10
Address: 192.168.4.123
but with pihole not
nslookup test.mytestdomain.local 192.168.4.2
Server: 192.168.4.2
server can't find test.mytestdomain.local: NXDOMAIN

Did I miss something?
Thanks for the help :slight_smile:
Regards

Please upload a debug log and post just the token URL that is generated after the log is uploaded by running the following command from the Pi-hole host terminal:

pihole -d

or do it through the Web interface:

Tools > Generate Debug Log

Hello,

this is the token link:
https://tricorder.pi-hole.net/tqk3TY44/

Regards

Edit:
Also the output of pihole.log
Because in the debug log was the request not shown:

Jan 13 19:54:15 dnsmasq[11204]: query[A] test.mytestdomain.local.fritz.box from 192.168.2.54
Jan 13 19:54:15 dnsmasq[11204]: cached test.mytestdomain.local.fritz.box is NXDOMAIN
Jan 13 19:54:15 dnsmasq[11204]: query[AAAA] test.mytestdomain.local.fritz.box from 192.168.2.54
Jan 13 19:54:15 dnsmasq[11204]: cached test.mytestdomain.local.fritz.box is NXDOMAIN
Jan 13 19:54:15 dnsmasq[11204]: query[A] test.mytestdomain.local from 192.168.2.54
Jan 13 19:54:15 dnsmasq[11204]: cached test.mytestdomain.local is NXDOMAIN
Jan 13 19:54:15 dnsmasq[11204]: query[AAAA] test.mytestdomain.local from 192.168.2.54
Jan 13 19:54:15 dnsmasq[11204]: cached test.mytestdomain.local is NXDOMAIN

Actually, Pi-hole will not send each query to all of the upstream servers at the same time.

As long as no DNS resolver is giving me a valid answer, I would have expected that.

I guess then right now the only way is to switch the DNS servers,
All query's to powerdns and forward it from there to pihole and finally to public DNS providers,
Or is there a way to force pihole to use always the custom servers first / idea to develop something in near future?

You can use only the custom server (powerdns) and remove all others from Pi-hole (no need to use 15 DNS upstream servers).
Powerdns can forward to the public DNS.

If you would want to restrict PowerDNS's usage as an upstream of Pi-hole to a specific private address range and search domain, this would sound like an opportunity to enable Pi-hole's Conditional Forwarding via Settings | DNS (right at the bottom).

That said, I see you seem to be using .local as part of your local/search domain.
Note that the .local TLD is reserved for mDNS usage and should NOT be used with plain DNS.

I guess that's the way I'm doing it.

Pointing all clients still to pihole (192.168.4.2) ->
1 Custom DNS-Upstreamserver 192.168.4.10:53 / PowerDNS Recursor
-> all "local" domains redirected to 127.0.0.1:54 / PowerDNS
-> all external domains redirected to a public DNS.

Yes Conditional Forwarding would be the better solution, but I can only add one entry there.
Or can I add multiple forwarding rules in the backend?
I have two locations, combined with a site2site vpn. I want to use multiple domains.

the .local was now only for testing. Later it will be something different.
My final architectural plan is not ready yet :laughing:

You can have multiple Conditional Forwarding targets, check this post:

Conditional forwarding on multiple VLANs - Help - Pi-hole Userspace

Just create the .conf file in the appropriate location and it will do the job. :slight_smile:

1 Like

That was easier than expected.
Thank you all.

I have added the file 02-custom.conf in /etc/dnsmasq.d
server=/test1/192.168.4.10
server=/test2/192.168.4.10

and it's working.

I guess I was thinking a little too complicated. I was aware of conditional forwarding, but I didn't think of solving it with this feature.
Even because the setting in the webinterface is only allowing one entry. I didn't think to look for it

Regards

Yeah, I myself became aware of this only after some lucky forum-scanning. Perhaps it would be a good idea to add some text (at least) to the Web Interface that says "for more conditional forwards, create custom config files per....." then a link to the docs or something of that nature.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.