Selfhosted
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
Rules:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
view the rest of the comments
If you're router has a failover DNS option, usually listed as DNS 2, I would set something like quad 9 as your backup DNS. Address is 9.9.9.9.
If you don't want to do that, then having a second instance of pihole running as the secondary DNS is pretty much your only good option
That's not how the two entries for DNS works. Devices will use both rather randomly, and therefore some requests will not be filtered.
The best way is to run two instances for redundancy.
Can you send me some more information on this because this is the first I've ever heard that it would not automatically pick the fastest closest and most responsive DNS system available.
No remote DNS server will ever be as fast as one that is local
I tried this. Put a DNS override for Google.com for one but not the other Adguard instance. Then did a DNS lookup and the answer (ip) changed randomly form the correct one to the one I used for the override. I'm assuming the same goes for the scenario with the l public DNS as well. In any case, the response delay should be similar, since the local pi hole instance has to contact the upstream DNS server anyway.
Yeah, looks like you don't know what you're talking about.
The second ipv4 DNS address is for redundancy and every network connected system will use the first one as long as it responds.
It's perfectly fine to have a single pihole and use something like quad9 as a failover in the unlikely event that your pihole goes down unexpectedly.
Actually they do know what they’re talking about. Configuring DHCP with multiple DNS servers isn’t for failover, it’s for redundancy. The result is ultimately operating system dependent, but modern Windows operating systems will query all configured DNS servers in parallel and will accept the first answer it receives. So if you configure your Pihole as one DNS server and a public DNS server as a second, a lot of your traffic will just bypass your Pihole ad filtering entirely.
Proof?
I read 15 different sites about DNS and not a one of them claimed anything like this. They universally all stated that your network attached devices would use the 1st one unless it didn't respond and only use the 2nd one if the 1st one did not.
So once again, I ask "Can you send me some more information on this" and not just claim it without any backup information?
I apologize if I am coming off rude, just my BS meter is getting close to the red zone and I would really appreciate some reliable evidence.
The best proof would be to just try it yourself and see what happens. Load up Wireshark, make a query, and look at your traffic. Because the problem is there isn’t a single technical article I can point you to that details exactly how DNS resolution works on every device running any given operating system. “Network attached devices” could be anything and so you can’t be certain exactly how each device will operate.
I’ll give you that in the case of Windows devices specifically, Microsoft isn’t good at keeping documentation up to date, and on older version of windows it used to work the way you describe. It would send the request to your first DNS server, wait one second for a response, and only if it didn’t get one would it move on to your next one. However in Windows 10 today if I edit my configuration so that I use a local DNS server located at 192.168.69.210 as my “Preferred” DNS server and 1.1.1.1 as my “Alternate” DNS server look what happens:
It sends the same request out to both without waiting and the response from Cloudflare actually comes in before the one from my local DNS server. So if this were a request for a blocked domain, the client would accept the response from Cloudflare because it was received first and so the request wouldn’t be blocked.
If what you said was true, my secondary Pi-hole wouldn’t have to respond to any queries. But it in fact gets quite a lot of them. As the other poster has said, it is about 80/20 for 1st and 2nd pihole. Sometimes the ratios are different, depending on the time of day (don’t ask me why….).
On the left is the DNS server that DHCP sets first. On the right is one it sets second.
This is a mixed machine network (Windows, MacOS, iOS, Android etc).
My clients will mostly pick option number one, but as you can see it's not a guarantee at all.
EDIT. Since lemmy doesn't show kbin images attached to comments https://media.kbin.pieho.me/81/1e/811e8f6bf8aa5e8ea9219ff52d1e61aec8624107ffd11f2a13631d0a1ac29abc.jpg
Run two and check the logs. You'll see about 20% of your requests will log on the second instance. So currently, that's 20% of your DNS requests not being filtered.
You'll also find some devices just latch on the the second and never use the first - again, in your scenario, these are not being filtered.
I can back this up with experience.
I'm actively running two piholes for years now. About 2/3rds of my traffic does go to the primary and some seem to 'lock on' to using just one, but most devices will swap between the two at their leisure.