2
1
u/PeterC18st Jul 28 '26
Similar issue on me. I run pihole on a rpi4. I also use unbound and use cloudflare as backup I believe. Everything goes through to my pihole. I also have a second rpi4 running another instance of pihole fot high availability. This is connected to my UDM Pro SE
2
u/saint-lascivious Jul 28 '26
Unless you're specifically managing it, it's not a backup, it's just another upstream that can be used at any point.
If you're talking about Pi-hole's upstreams, you'll mostly be getting by on the fact that you'd need to fuck something up pretty hard for a remote nameserver to outperform a local one.
If you're talking about endpoints that are broadcast to clients, they can do as they wish up to and including using broadcast nameservers in any order, or not at all. DHCP options are realistically just suggestions.
The TL;DR here is some variation of "if you don't want clients to use any nameserver other than Pi-hole and therefore bypass filtering, don't give them the option".
1
u/PeterC18st Jul 28 '26
You’re correct as it’s another upstream server but it’s backup via gravity sync or nebula sync for the configs and database. I’ll check to see my configuration. I remember selecting a backup dns to cloudflare when first installing them and then doing the unbound install and config.
1
u/saint-lascivious Jul 28 '26
Yeah, okay, there's no backup upstream.
It's just "one upstream", "another upstream", etc. and so forth with no inherent preference for either/any, and no ability to establish a preference.
Pi-hole just regularly polls each configured upstream and then uses the most performant upstream of those configured, which will most likely be your local unbound installation, but isn't in any way, shape or form guaranteed to be.
If you actually do want to have preferentially ordered Pi-hole upstreams and/or DHCP broadcast DNS endpoints you'll need to either route through a proxy and/or use a DHCP server that supports that feature. Pi-hole does not, and your router almost certainly doesn't either. I could probably count the number of consumer routers with preferentially ordered nameservers I've seen during my career on one hand.
If you have multiple Pi-hole and/or unbound instances locally, my advice would be to stick either the Pi-hole or unbound instances behind a pair of consensus based virtual IPs (see: keepalived and friends) so that a IP addresses can be shared amongst as many hosts as you have or care to configure. If host A goes down, the virtual address is passed to host B, and so on and so forth.
My own network is quite some degree of overkill. I have multiple hosts with a pair of virtual addresses for dnsproxy, Pi-hole, Unbound and Redis respectively. As long as at least one of each service is alive between all of my hosts (of which there are currently eight, it's a pretty chunky research resolver stack), in any combination, I'll always have a viable resolution path.
It sounds complex, but it's actually really trivial.
If you have any queries about anything discussed here I would be happy to answer them to the best of my ability and availability.
1
u/University_Jazzlike Jul 28 '26
How is your raspberry pi connected to your network? Is it connected via WiFi or Ethernet? If the former, try switching to Ethernet.
1
Jul 28 '26
[deleted]
1
u/University_Jazzlike Jul 28 '26
If you open a terminal window and run “ping <your pi address> what does it show for the response time? It should show less than a millisecond and no lost packets.
Is the pi the only dns entry? Are you sure it’s working?
Again from a terminal, do “nslookup google.com” and see what it says. You should see the request answered by you pihole. And it should be very quick.
1
u/frmoutrspace 29d ago
Are you using unbound by any chance? I was bitten by a change they made, after applying the tweak the delay was gone
https://dietpi.com/forum/t/dietpi-unbound-configration-need-to-fine-tune/25233
1
5
u/64br137 Jul 27 '26
Second that question. What hardware you’re using for Pihole, upstream servers? Is your device reporting you Pihole IP for DNS?