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.

  • rentar42@kbin.social
    link
    fedilink
    arrow-up
    22
    ·
    10 months ago

    The issue is that according to the spec the two DNS servers provided by DHCP are equivalent. While most clients favor the first one as the default, that’s not universally the case and when and how it switches to the secondary can vary by client (and effectively appear random). So you won’t be able to know for sure which client uses your DNS, especially after your DNS server was unreachable for a while for whatever reason. Personally I’ve “just” gotten a second Pi to run redundant copies of PiHole, but only having a single DNS server is usually fine as well.

    • Kir@feddit.itOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      10 months ago

      This answered my question. Thank you. I guess I will sacrifice redundancy

        • dorkage@lemmy.ca
          link
          fedilink
          English
          arrow-up
          3
          ·
          10 months ago

          I run multiple pinholes using keepalived. Then I only use one DNS in my DHCP server. Second pihole will seemlessly take over if the first one goes down whilst using the original DNS address.

          Work quite well. I had to learn the hard way that only using a single pihole was just asking for my partner to be mad when it didn’t work / when I was doing server maintenance. Now I have multiple and they can all seemlessly take over if any my server nodes are down

  • mateomaui@reddthat.com
    link
    fedilink
    English
    arrow-up
    16
    arrow-down
    1
    ·
    10 months ago

    I would avoid it, as it may use the alternate instead of the pihole at anytime. If you want redundancy, it’s best to have a second pihole.

  • seedd@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    edit-2
    10 months ago

    I tried that, devices just request to alternate dns when they get nothing from pihole. I use adgh, and ig there is a setting where you can set the answer to blocked stuff, like 0.0.0.0, empty…etc. if you set thay to 0.0.0.0, devices won’t query 2nd dns (i hope) when adgh is up. But it is best to have a 2nd pihole/adgh, i have one on my proxmox and another on a pi, synced with adgh sync Edit: if you don’t have another pi, use nextdns

  • Darkassassin07@lemmy.ca
    link
    fedilink
    English
    arrow-up
    5
    ·
    10 months ago

    I setup a second pihole for redundancy.

    90% of network traffic uses the primary, but some things like to use both or exclusively the secomd one on random days.

    I use Gravity-Sync to keep the settings/lists between them identical. (lots of local dns records for local self-hosted stuff, and each device has a static ip + dns record to identify it easily in logs)

  • TCB13@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    10 months ago

    mary DNS Server: Clients will first attempt to use the primary DNS server specified in their network settings. This ser

    What’s the point tho? If your PiHole fails you need to know otherwise you could be risking days / months of web surfing in the fallback DNS server without even noticing it.

    As for a reply, there’s no RFC that specifies that a specific order is applied to DNS servers. So in short, you can’t have a fallback that is reliable and most operating systems will just load balance or opportunistically pick between the two.

    • Kir@feddit.itOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      10 months ago

      Thank you, this is what I was worrying about. As for the “why”, even if my server is quite stable, a shutdown may be necessary and sometimes slowdowns with pi-hole happened. Some redundancy would have been better.

      • TCB13@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        10 months ago

        Well, I’m not sure you read the other comments but there is confirmation that for clients there isn’t an order for DNS servers from RFC2182:

        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.

        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.

  • Decronym@lemmy.decronym.xyzB
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    9 months ago

    Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

    Fewer Letters More Letters
    DNS Domain Name Service/System
    PiHole Network-wide ad-blocker (DNS sinkhole)
    VPS Virtual Private Server (opposed to shared hosting)

    [Thread #433 for this sub, first seen 17th Jan 2024, 09:35] [FAQ] [Full list] [Contact] [Source code]

  • BentiGorlich@gehirneimer.de
    link
    fedilink
    arrow-up
    3
    ·
    10 months ago

    You should put your pihole server in the dns server in the network settings. My mobile devices didn’t use my pihole server until I changed the dns server configured there… (I am using a FritzBox as well)

  • nul9o9@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    arrow-down
    2
    ·
    10 months ago

    I’ve set my secondary DNS to cloudflare, and my pihole still blocked ads for me. I assumed the secondary DNS server is used only if the primary can’t be pinged. But i haven’t actually looked into it.

  • SimonSaysStuff@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    arrow-down
    3
    ·
    10 months ago

    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.

  • Tolstoy@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    10 months ago

    AFAIK the FritzBox switchs mainly to the faster DNS Server. I tried to use Quad9 with cloudfare as the second DNS server, most of the time cloudfare was the used since it was a bit faster.