this post was submitted on 17 Jan 2024
29 points (96.8% liked)

Selfhosted

40313 readers
185 users here now

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:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. 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.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

Hy everyone, I have a PiHole instance running on my home server, and I changed my router (Fritz box) DNS in order to use my PiHole. Everything runs great.

I was wondering if I can put another DNS provider on my "alternative DNS server" in my router, in order to have a fallback alternative in case my server is down, or if I should avoid it.

I'm asking this because I don't know if the request will be handled in parallel between the two DNS provider (that would make my PiHole useless) or not. Thank you.

you are viewing a single comment's thread
view the rest of the comments
[–] SimonSaysStuff@lemmy.world 1 points 10 months ago (3 children)

When you specify more than one DNS server for network clients, the order in which these servers are used is not random. The following sequence is observed:

Primary DNS Server: Clients will first attempt to use the primary DNS server specified in their network settings. This server is often considered the default.

Secondary DNS Server: If the primary DNS server is unavailable or unable to resolve a query, clients will then attempt to use the secondary DNS server. This server acts as a backup.

So in OPs case his Pihole will always be used if it's available, and only when it's not will the secondary be used.

[–] mateomaui@reddthat.com 7 points 10 months ago

Except that, as I’ve already mentioned, I have two piholes, and sometimes both will be receiving requests. Based on your description, the second would never receive requests as long as the first is online. Perhaps this is router dependent, but it’s what I’ve observed.

[–] TCB13@lemmy.world 3 points 10 months ago (1 children)

There's no RFC that specifies that a specific order is applied to DNS servers.

[–] SimonSaysStuff@lemmy.world 0 points 10 months ago (2 children)

RFC 2182 details the operation and functionality of secondary DNS servers. Which defines/influences how resolvers behave with multiple DNS servers.

[–] TCB13@lemmy.world 0 points 10 months ago* (last edited 10 months ago)

A number of problems in DNS operations today are attributable to poor choices of secondary servers for DNS zones

That RFC is about DNS servers in the context of DNS zones in domain names. Not for a DNS client running DNS queries like an operating system. And the RFC is very clear about this:

The distinction between primary and secondary servers is relevant only to the servers for the zone concerned, to the rest of the DNS there are simply multiple servers.

For your Windows, Linux whatever machine "there are simply multiple DNS servers".

Which defines/influences how resolvers behave with multiple DNS servers.

It doesn't. As I said in another comment "most operating systems will just load balance or opportunistically pick between the two", and there's the relevant part from the RFC:

All are treated equally at first instance, even by the parent server that delegates the zone. Resolvers often measure the performance of the various servers, choose the "best", for some definition of best, and prefer that one for most queries.

[–] ramble81@lemm.ee 2 points 10 months ago

What you stated is generally a Windows only feature. Other OSes don’t adhere to that. Drives me crazy on Windows Servers too.