I’ve started a homelab a few months ago, and since then it looked more or less like this:

  • DNS server - with one wildcard record “*.srv.lan” pointing to my reverse proxy (I don’t have a proper domain yet)
  • Proxy (traefik) - forwards the requests to specific services (nas.srv.lan -> NAS, photos.srv.lan -> Immich etc.)

An issue showed up when I got around to setting up samba, where because I have a single wildcard DNS record, and the proxy runs on http(s), I cant forward SMB requests to the server, other than using its ip. The same issue arose when I wanted to get dns-based ssh working (even though I have nas.srv.lan set up, ssh-ing that gets me onto the proxy instead of the nas, which makes sense with the dns setup)

One solution that came to my mind would be making each service (I’m using vms, so each service is a different host) have a separate reverse proxy, as well as making the DNS server have all the records separately (nas.srv.lan -> NAS ip, photos.srv.lan -> Immich ip etc.) and then perform the proxying on the hosts. That would lead to me having a dozen different reverse proxies, wasting resources and making managment more difficult.

Are there any other things I could try?

  • toebert@piefed.social
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 小时前

    You can have *.srv.lan point to your reverse proxy, and then just add something.srv.lan to point to somewhere else as well as another record. The exact record will overwrite the wildcard, but things would default to the wildcard.

    Alternatively, your router’s DHCP server should make things accessible under a local domain, sometimes it’s just .lan, or .local, or .home. If it’s nice it’d set the DNS search to that by default so you may be able to just ping the hostname of a device without any domains. Using those, you could keep your wildcard for services behind your reverse proxy vs devices on your network using the hostnames.

    You could also consider structuring your domains. E.g. $device.lan = the network interface. *.$device.lan = the reverse proxy on it.