Server Version#: Latest
Player Version#: Latest
<If providing server logs please do NOT turn on verbose logging, only debug logging should be enabled>
Dear fellow Plex users,
Been using Plex for many years successfully but lately I’ve been having an issue that I cannot solve and I cannot find answers online.
It appears that my Windows Plex app (as well as plex-web player) are using remote video quality setting when playing media locally. Specifically, I recently started travellling where I need to stream from my home server on a poor internet connection so I have set my remote quality to 0.3 Mbps. However, when I get back home it is still using that same remote quality.
I believe all my settings are correct. In server settings I have added my local subnet to be treated as local traffic (my player computer IP is 192.168.1.10; Plex server machine is at 192.168.1.3 however it’s in a Docker container and from what I understand those have internal networks). I have selected the box to treat WAN IP address as local traffic. Finally, I have set player settings to Automatic under Home streaming (I have also tried changing to maximum quality but nothing changed). This happens in both Plex Windows app as well as Plex Web.
More importantly, when I check the stream in Dashboard it is identifying it as Local playback with my WAN IP next to it. My Plex server is in a Docker container on my local NAS running latest Truenas SCALE with their Docker implementation. Initially I thought that maybe I have a problem with network configuration given how Docker has it’s own internal network which I don’t completely understand. However, the fact that the server can identify traffic as local is confusing me and makes me think it’s something else.
I have attached some screenshots just to show the settings I have described above.
Any ideas on what’s causing this and how to fix this?
I suspect a DNS issue; DNS rebinding protection specifically. DNS rebinding protection is a feature of many DNS servers which prevents them from resolving FQDNs to local (RFC-1918) IP addresses.
This negatively impacts Plex because each server gets its own FQDN for local, secure access (potentially several, but always at least one if the server is signed-in). If it can’t be resolved by the DNS server Plex falls back to using the public FQDN for the Plex server (if the server has remote access enabled or a custom server access URL). (This works because of another feature of routers called NAT hair-pinning or loopback.)
Many routers will default to using the ISP’s DNS servers. Often, these have DNS rebinding protection enabled.
The easiest solution is to tell your router to hand out alternate, public DNS server information to devices via DHCP. My suggestion would be CloudFlare DNS (1.1.1.1, 1.0.0.1). They’re privacy-minded and known to work with Plex.
So, head into your router’s configuration interface and find the area where you configure DHCP. There should be options there to allow you to configure (at least) primary and secondary DNS servers. Set the primary to 1.1.1.1 and the secondary to 1.0.0.1). Alternatively you can use other known working servers (Google: 8.8.8.8, 8.8.4.4).
After making/saving those changes, restart any clients where you use Plex apps to force them to renew DHCP and thus get their new DNS server information.
If you have any trouble configuring this provide your router manufacturer and model and maybe some screenshots showing its DHCP configuration settings.
Thank you for your response. I actually already use CloudFlare DNS. And I just verified, both my client PC and server have been handed out the correct 1.1.1.1 DNS.
Could this be something with the Docker configuration? The machine itself uses 1.1.1.1 DNS but is there any chance the Docker network somehow uses a different one? I really don’t understand Docker networks at all, never had to look into them. Everything seems to just work.
Edit: I just read up on Docker networking, it uses the host machine DNS by default. In particular, it looks it up in /etc/resolv.conf which I just checked and it has CloudFlare DNS servers in there as setup on the host. So it really looks like DNS is set correctly.
It’s possible. Can you share some information about your container configuration?
Which network driver are you using? If using docker run it’s set by “network.” If using Compose, it’s “network_mode.” If you don’t specify anything, the bridge driver is used.
Are you setting the ADVERTISE_IP environment variable in your config? If so, to what (it should be the host machine’s IP address)?
Which Plex Media Server image are you using? The Plex official one or one from a third-party (linuxserver.io for example)?
Did you install this as a TrueNAS app (this still creates a container using the Plex official image) or manually via the command-line using Docker CLI commands?
Short answer to most of your questions is I’m not sure. I’m using the regular Truenas app and I’ve installed it through GUI. I’m not entirely sure what they’re using under the hood. As far as I know it’s standard Docker but they might be doing something differently.
I am not using the ADVERTISE_IP or any other environment variables, just default config from Truenas.
I just checked my Plex config in Truenas and I might be onto something. Under Network there’s an option for host networking which is unchecked by default so I’m presuming I’m running in bridge mode? If so, Plex docker installation instructions on Github say that I should be setting ADVERTISE_IP as you’re suggesting which I have not.
Do you think this might be the source of my issues and, if so, what would be the best way to solve it - use host networking or set ADVERTISE_IP variable? I did not check host networking because in Truenas GUI they say it’s recommended to leave it unchecked. However, Plex docker instructions on Github suggest that host networking is the easiest way to install Plex and avoid issues. Would I even be able to switch to host networking now without reinstalling Plex?
I haven’t attempted changing either as I don’t have a proper backup right now. Sounds like you understand these things much better than I do so if you think reconfiguring the network in one of the above ways will help I’ll make some proper backups and will try that later today.
I’m still a bit puzzled as to why my Dashboard (as well as Tautulli) says that I’m playing media locally and yet it’s still using remote settings. You’d think that if Plex as able to identify this traffic as local it would do EVERYTHING locally. It’s probably not that simple under the hood
Yep, if that box isn’t checked then it’s using the bridge driver. I’d suggest trying one of these two (not both):
Try adding the ADVERTISE_IP environment variable to your Plex app config. It should be set to the IP address of your TrueNAS host; or,
Check the Host box in the Plex app config.
Personally, I’d go with the second option. This exposes Plex via the host’s IP address and is generally a bit easier (no need to publish the ports used by Plex). I’m not sure if the TrueNAS app for Plex takes care of publishing the correct ports automatically. That would be required for the first option to work.
That’s caused the route the client is taking to the Plex server. The client will try the local connection information first which, since the bridge driver is being used, will be something like 172,17.0.x. Your router likely doesn’t have a route for this so the connection fails. The client then falls back to the public connection information for your server which will be your WAN IP address. Your router does know how to route that (it’s a public IP so it sends it to the WAN interface). However, since the traffic is being sent to its own WAN IP address it gets “hair pinned” back to itself.
So, from a connection standpoint, it appears the traffic is coming from your own WAN IP. Since you’ve configured configured Plex to treat connections from your WAN IP as local, it gets labeled as such in the Dashboard (an anywhere else which shows this information.
Thank you, problem solved. I selected host networking in Truenas config and everything works expected. In fact, in Plex dashboard I can see my local client IP now as opposed to my WAN IP.
I understand your explanation as to how it works. However, I thought that the option to treat connections from WAN IP as local was there specifically for this reason - in case traffic is “hair pinned” it would still treat it as local and apply local settings.
Either way, it was a very easy fix. I had backup but it was a simple as checking the host networking option and restarting the app/container.