Jellyfin Forum
Prefer local connection on LAN - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: General Questions (https://forum.jellyfin.org/f-general-questions)
+--- Thread: Prefer local connection on LAN (/t-prefer-local-connection-on-lan)



Prefer local connection on LAN - krojew - 2025-07-06

Hi,
I just installed Jellyfin and I'm trying to understand how to setup local and external connections in a way that a client connecting via an external address uses the LAN connection. I've previously used Emby and it had such an option available - entering both local and external addresses meant the client app switched to direct LAN connection, when in the same network, and external address otherwise. Is such a thing possible in Jellyfin?


RE: Prefer local connection on LAN - Generator - 2025-07-06

When the client is on same network it will use the LAN IP, but if you want to remove any restrictions you can add the IP mask on network settings "LAN networks" (ex: 192.168.1.1/24)


RE: Prefer local connection on LAN - krojew - 2025-07-07

(2025-07-06, 08:38 PM)Generator Wrote: When the client is on same network it will use the LAN IP, but if you want to remove any restrictions you can add the IP mask on network settings "LAN networks" (ex: 192.168.1.1/24)

I tested this on two devices and it's not the case - even when in the same LAN, using external address causes the connection to go through the external route. The logs show the external IP and external transfer limits apply.


RE: Prefer local connection on LAN - I-G-1-1 - 2025-07-07

On your router (or on the device that you use as DNS server on your LAN) add a line to the hosts file: ip-of-the-machine-running-jellyfin external-url

At this point even if you use the URL any client inside the LAN that uses the router as DNS server will connect directly to the ip-of-the-machine-running-jellyfin without exiting to the internet.

If any of the client devices use some sort of DNS "protection" that ignores the router DNS you have to change the hosts files in each client devices


RE: Prefer local connection on LAN - krojew - 2025-07-07

(2025-07-07, 08:29 AM)I-G-1-1 Wrote: On your router (or on the device that you use as DNS server on your LAN) add a line to the hosts file: ip-of-the-machine-running-jellyfin external-url

At this point even if you use the URL any client inside the LAN that uses the router as DNS server will connect directly to the ip-of-the-machine-running-jellyfin without exiting to the internet.

If any of the client devices use some sort of DNS "protection" that ignores the router DNS you have to change the hosts files in each client devices

That's what I ultimately did, but I wondered if there's some built-it mechanism for that like in Emby.


RE: Prefer local connection on LAN - Generator - 2025-07-07

Something is not right on your LAN, even if i connect using external domain, still uses the local IP, not external.
Do you have any VPN or proxy causing issues?