I run CachyOS on my desktop. I host Homepage for myself on a home server. This is reached at home.mydomain.tld. Pihole on my local network catches that request and points it at my local nginx, which reverse proxies me to the homepage.

Now, I set this all up a while back and it all worked totally fine for several weeks. Then, about a week or so ago, for some reason almost every, but not every time I boot my PC, home.mydomain.tld gives me a “cannot be reached” error in my browser… until I run systemctl restart NetworkManager and then it works completely normally.

Can anyone help me troubleshoot why oh why that would suddenly be a thing? Does anyone have suggestions of a way I can troubleshoot a permanent fix to this so that I don’t have to restart NetworkManager almost every boot?

  • ligma_centauri@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    20 hours ago

    Do you have multiple NIC? I sporadically run into issues where traffic will try to route itself via a secondary network which has limited external access and it is resolved in a similar manner, by bringing down all networks, then re-starting them in a specific order.

    Realistically I should probably define some static routes, but it works automatically 99% of the time so I never bother.

    If this sounds like a possible cause, check your routes while in failed, and functional states, and set static routes as needed to resolve.

  • Pogogunner@sopuli.xyz
    link
    fedilink
    arrow-up
    11
    ·
    1 day ago

    The output of dmseg or journalctl might show you an error message related to networkmanager to give you some clues

  • Taasz/Woof@piefed.social
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 day ago

    So I would start with checking if the request is reaching PiHole.

    Next time it breaks, before restarting networkmanager, go check the pihole requests log and see if your DNS queries are even showing up there.

    If they are, what does pihole show it’s returning for the query, is it the correct IP?

    If that’s working properly then I would check if you can ping the server by IP directly, make sure that connection is working.

    • iamthetot@piefed.caOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 day ago

      I will check this next time it happens (I’m very confident that will be later today lol)

      Out of curiosity, can you think of a reason why a problem with Pihole would be fixed by restarting my NetworkManager? I was certain the problem had to be on my pc.

      • Taasz/Woof@piefed.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        20 hours ago

        I don’t think it’s a problem with PiHole realistically, it sounds more like for some reason your DNS requests are not getting to PiHole.

        • iamthetot@piefed.caOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          15 hours ago

          Can confirm, when this happens my requests from desktop are not getting to pi-hole. Works from my phone without issue.

          • Taasz/Woof@piefed.social
            link
            fedilink
            English
            arrow-up
            1
            ·
            4 hours ago

            Nice, narrowing it down!

            Next thing I would check is your configured DNS servers on the desktop, it needs to have only the pihole IP, if it has any other servers configured that is likely the issue.

            Also worth pinging the pihole IP next time it’s not working, to check if it’s actually a networking issue instead of a DNS issue.

  • frongt@lemmy.zip
    link
    fedilink
    arrow-up
    9
    ·
    1 day ago

    Ugh, this is the bane of my existence. For decades, this worked reliably. Then they introduced networkmanager and systemd-resolved, and everything went out the window and now it’s impossible to trace behavior.

    I would verify your network and dns settings. One or both of those things I mentioned are probably interfering in resolution.

    • iamthetot@piefed.caOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      15 hours ago

      No, the DNS calls do not show up in pi-hole log when it’s not reaching destination. If I do it from my phone, which works fine and has never not resolved for me, they show up on pi-hole as expected.

      • Petter1@discuss.tchncs.de
        link
        fedilink
        arrow-up
        2
        ·
        10 hours ago

        Hmm, interesting…

        But we learned now, that your desktop somehow isn’t reaching your DNS (pi-hole) until restart of Network Manager

        So next thing i would do is traceroute and dig on your desktop while it is not working, to see what DnS is used in this state

  • chromeleon@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    2 days ago

    I’m pretty clueless, but perhaps try putting a short time delay on the NetworkManager service startup.

  • Scoopta@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    1 day ago

    Is your pihole server the only DNS server set? Either on your PC or router? Is network manager sometimes using a different nameserver?

      • Scoopta@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        21 hours ago

        nmcli device show eth0

        Or replace eth0 with whatever interface it is. Will give you a list of all network parameters including the DNS servers. There ideally should only be one, your pihole

        • iamthetot@piefed.caOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          16 hours ago

          There is only one IP4 DNS address, however there are two IP6 DNS addresses for my ethernet interface. However, I also notice that the GENERAL.CON-PATH ends in 2, whereas I have another interface lo which ends in 1. Would that be a clue of anything?