I created a short tutorial on using sub domains to access services hosted within my home network, thought I would share it here in case anyone finds it useful

This is the first time I’ve made a technical tutorial so apologise if there are mistakes/its confusing, feedback will be appreciated

    • Estebiu@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 months ago

      It works well, but if you want to do ‘custom stuff’ (like hosting a matrix instance) you’ll be out of luck

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

      Yeah it was honestly changing the router settings that was the hardest part for me, exposing port 22 and 80. Caddy was really easy to use

  • ragica@lemmy.ml
    link
    fedilink
    English
    arrow-up
    6
    ·
    2 months ago

    You seem to have descibed your port forwards backwards It is the router forwarding the ports to the gateway pi (and potentially other devices), not gateway pi and other devices forwarding to the router. The forwards to servers are incoming from the internet.

    (Theoretically you could have your pi physically between the router and the internet (modem) acting as a sort of pre-router, but this would be unusual. Perhaps you could describe your physical setup more clearly. What is physically/wirelessly connected to what, to the internet.)

  • BonkTheAnnoyed@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    1
    ·
    2 months ago

    Very cool, great work!

    Worth noting about this approach is that the global list of subdomains is publicly searchable. So, you’ll see vulnerability and AI scans on those endpoints.

    If that’s a concern for you, using path-based routing (e.g. Apache VirtualHost) allows you to use difficult to guess paths to your cloud.

    • wildbus8979@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 months ago

      Worth noting about this approach is that the global list of subdomains is publicly searchable.

      Can you expand on this? What is it that you call the “global list of subdomains”?

        • wildbus8979@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          4
          ·
          edit-2
          2 months ago

          Except it isn’t. Saying it is trivial is just gross generalization. It’s trivial to configure bind to have internal zones that aren’t resolvable publically. It all depends on configuration, such as reverse ns entries, zone accessibility, etc.

          You can have (sub)domains that are listed in the certificate lists and yet aren’t resolvable externally as well.

          • BonkTheAnnoyed@lemmy.blahaj.zone
            link
            fedilink
            English
            arrow-up
            1
            ·
            edit-2
            2 months ago

            Actually, wait. Something you a said might actually be just what I’m looking for: you mean that I can have DNS entry for mydomain.com and no additional CNAMEs, and have a cert for nextcloud.mydomain.com (or wildcard maybe?) and somehow still be able to use name based virtual servers?

            Hmmm. I thought I was going to be limited to path-based.

            Explain more?

            • wildbus8979@sh.itjust.works
              link
              fedilink
              English
              arrow-up
              2
              ·
              edit-2
              2 months ago

              Absolutely. Simply use ACME with the DNS validation method. Using bind you’ll want to create keys and allow TXT access for those keys to the validation domains. Fear not, this isn’t exclusive to bind, ACME tools supports dozens of other backends. That’s all you need the actual domain doesn’t need to be resolvable with an A/CNAME record. Internally you can run an entirely different DNS server to resolve your hosts, use hosts files, or use bind zones.

          • BonkTheAnnoyed@lemmy.blahaj.zone
            link
            fedilink
            English
            arrow-up
            1
            arrow-down
            1
            ·
            2 months ago

            Okay. Yup, that’s probably true. I’m not that deep into network stuff. But, if you’re just doing the basic, ‘ha.mydomain.com => 121.41.38.9’ that works out of the box with name based virtual hosts and reverse proxy, then yeah, you’ll get traffic on that within 24 hours.

            I reckon if a person understands what you’re talking about though, they’re already doing better than most.

  • pathos@lemmy.ml
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 months ago

    Oh I thought it was sub domains for localhost. I actually wonder now if that’s possible.