How do you guys set internal domains?

Say i dont want to type 192.168.1.100:8096 and want a url instead, say jellyfin.servername - how would I go about that? I don’t want it exposed online via reverse proxy. I don’t need certs. No port forwarding on the router.

How do I type ‘jellyfin.servername’ into a browser and being up the jellyfin dashboard?

      • novarimeOP
        link
        fedilink
        arrow-up
        2
        ·
        2 years ago

        Yeah, how and where? In the docker compose? I have a dozem containers and is love if they were all a.server. b.server, c.server. How can I do this? Pihole DNS records don’t do anything at the port level.

        • jjakc@lemthony.com
          link
          fedilink
          arrow-up
          8
          ·
          2 years ago

          Sorry I meant in your browser. Yes dns does not point to ports.

          You would have to use some sort of reverse proxy that is only accessible from internal networks

          • novarimeOP
            link
            fedilink
            arrow-up
            1
            ·
            2 years ago

            Gotcha. I have nginx proxy manager on the go and I’ve heard caddy is simple, so i’ll see how I get on. Thanks for the advice.

        • Captain Janeway@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          2 years ago

          Just to clarify a bit further. You browser doesn’t specify ports in the URL because HTTP and HTTPS have basically coopted the 80/443 ports. You could have a website running an HTTP server on another port like 3000. But then you’d need to specify the port in the URL since the browser - by default - is looking at 80/443 and not 3000.

          You should be able to configure the port for your Jellyfin server. I’m not a Jellyfin user, but most applications allow you to pick a port to run it on. So you’ll have to change the port to port 80 and then expose that port on your docker container in the docker-compose file.

          Edit: actually now that I think about it… You could just point your local port 80 to the docker container port. I forget the port mapping schema but it’s something like

          ports:
            - 80:1234
          

          You might have to flip the order of the ports. But basically that example above is trying to map port 80 to port 1234. If that fails, you might have port 80 being used by another application on your computer and you’d either have to shut that app down, pick a different port for that app or you’re back to picking a different port for Jellyfin

    • novarimeOP
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      It’s the port that’s tripping me. How do I point jellyfin to that domain? It’s on docker on port 8096 - the hostname isn’t the problem, it’s the container.

      • plo@kbin.social
        link
        fedilink
        arrow-up
        7
        ·
        edit-2
        2 years ago

        Ah okay. You need some sort of reverse proxy.
        I really like caddy. Using it with caddy-docker-proxy in docker-compose makes it quite nifty:

        version: '3.7'
        services:
          whoami:
            image: containous/whoami
            networks:
              - caddy
            labels:
              caddy: http://whoami.mylab.home
              caddy.reverse_proxy: "{{upstreams 80}}"
        
        networks:
          caddy:
            external: true
        
        

        Just make sure to explicitly use ‘http’ instead of ‘https’. That way it won’t try to create certificates.

        • novarimeOP
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          Cheers. I appear to have something of a mental block with revese proxies. I’ve used them successfully, but couldn’t definitively say I understood them enough to get on with things. I’ve always had some niche condition on my end that was slightly different to the guide or video I was watching which snafued the process.

          I have nginx proxy manager currently up and running and set up wildcards, but no dice on actually mapping anything properly, and there are multiple layers where things can be misconfigured, so diagnosis takes time, which is hard to come by at the moment.

          What this post has taught me, is that I need to just spend a weekend playing with reverse proxies enough til they’re sunk in. Thanks again for the advice.

  • TheButtonJustSpins@infosec.pub
    link
    fedilink
    English
    arrow-up
    9
    ·
    2 years ago

    You don’t need to expose it to the web to use a reverse proxy. You can use traefik, caddy, nginx, or any other reverse proxy to serve IP:PORT on domain.tld. You can use 80 or 443 as you’d like.

    If you’re using docker, it’s even easier. How are you hosting your jellyfin?

  • ilovetamako@lemmy.fmhy.ml
    link
    fedilink
    English
    arrow-up
    9
    ·
    2 years ago

    I use a pi hole instance for this. I just point all the subdomains at my ngnix server and reverse proxy everything through that

  • finn@lemmy.world
    link
    fedilink
    English
    arrow-up
    9
    ·
    edit-2
    2 years ago

    I use pihole running on an esxi server for dns. In pihole you can create local dns records which is exactly what you’re trying to do. It’s very lightweight, you can run it on about anything.

    You can also do something like this

    • novarimeOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 years ago

      Thanks. It was the ports that were more of an issue. It’s one server with several containers and id like a local “url” for all of them, but looks like reverse proxies aster my only out, which is a shame because i’m dumb.

  • asjmcguire@kbin.social
    link
    fedilink
    arrow-up
    5
    ·
    2 years ago

    PiHole as your DNS resolver. LocalDNS mapping whatever hostname you want to whatever IP you want.
    Because I use Nginx Proxy Manager internally - then most of my hostname point to the Nginx IP address

  • StrayPizza@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 years ago

    I currently use a custom filter/rewrite in AdGuard Home (similar to pihole).

    An alternative to running a central dns server is to use mDNS. You can install a daemon on each server that you want to access via hostname, and then clients know that ServerName.local domains should be resolved using mdns. They send out a dns query to a local multicast IP, the daemon on the servers receives the query and the appropriate one responds. By design it’s local only.

    • novarimeOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 years ago

      Thanks. I got some reading/watching to do.

    • novarimeOP
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      2 years ago

      The host isn’t really the issue. It’s the container. How do I access the container with a name rather than number.

  • kamin@lemmy.kghorvath.com
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 years ago

    You need to set up a local DNS server with a .servername zone and point your machines to it. You’d add an external DNS server like 1.1.1.1 as forwarder to allow internet traffic to still resolve.

  • priapus@lemmy.one
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 years ago

    Reverse proxy and local DNS. Just add the domains you want to your DNS and point them at the reverse proxy.

    • novarimeOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 years ago

      Thanks. It’s the reverse proxy part i’m scared of. For some reason theyve just never clicked with me.

      • priapus@lemmy.one
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        2 years ago

        I get that, they’re a bit confusing at first. I’d highly recommend looking at Caddy, it’s configuration is very simple. Really all you have to do is pick a domain name and point it at the correct port. If you’re only accessing locally you don’t even need to buy a domain.

        • novarimeOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          2 years ago

          I have a domain, but if I don’t have to use it, all the better. So with a reverse proxy, if i don’t want it accessible on the web, i can literally pick anything? I could call it “watch.tv” if i wanted?

          • priapus@lemmy.one
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 years ago

            Yep! If you have a local DNS server such as a pihole you could just manually add watch.tv to your local dns records and set the IP as your servers IP. If you don’t have a local DNS server, you can just add it to your hosts file.

            Once you do this, any requests to that domain will go to your reverse proxy, which if set up correctly will send you to Jellyfin.

  • dan@upvote.au
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 years ago

    You should be able to use mDNS pretty easily. Some services (like Home Assistant) support it out-of-the-box. mDNS is what powers the .local domains (eg homeassistant.local).

  • philipcristiano@lemmy.philipcristiano.com
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 years ago

    Running a reverse proxy then adding your IP to your router/other-DNS-server will make it easy ish. Just don’t pick a domain that is used by other people. If you have a(ny) domain you own then a subdomain you set in your router is fine/safe.

    I have *.[house domain] point to a static IP set in my router. The IP is announced via BGP to point to running Traefik instances as a reverse proxy that points to the appropriate container. This also gives certs, but isn’t required.