I have exactly the same issue. While im using a docker container, I specify the âadvertise ipâ and plex.tv still has my wan ip, so it sees everything as âexternalâ I dont know how to retrieve or change the IP that is published on plex.tv (searching for API docs nowâŠ)
From the debug logs:
Message
Request came in with unrecognized domain / IP â38.29.x.xâ in header Host; treating as non-local
This is a great question. I would love to know why my wan IP is published on plex.tv even though I have set the advertise URL to my internal ip (not the docker container but the docker host).
I port forwarded :32400-> docker host ip as I always have, but clients are getting the wan IP, rather than the internal IP. When i look at dockerhost:32400/servers/ i see the docker container IP listed there.
It all makes no sense.
When I hit http://10.0.1.3:32400/web/index.html#!/ and watch the console at the same time (in debug mode) thatâs when I see Request came in with unrecognized domain / IP '38.29.xx.xx' in header Host; treating as non-local
Your WAN IP is published (held internally) by Plex.tv
Someone you share with wants to look at your library and play something
Plex.tv gives their client app (hidden internally) your IP address ; It is a âDNS providerâ for all Plex servers.
The app connects to your server and makes the âshow meâ query.
You see the results as sent directly by the server to you. Plex.tv does not get involved.
You want to play something;
â The app, now knowing the IP address of the server, sends the request directly to it.
â The server authenticates the request & checks if allowed
â If allowed, the server and client establish a https point-to-point encrypted connection.
â Playback begins and runs through that point-to-point
Clients will always be able to find your WAN IP if they really want to.
An unscrupulous person would only need to go into their modem/routerâs firewall and look at all the connections passing through it.
Only WAN IP addresses are routable on the internet. For your server and the client to talk, WAN IP addresses must be used. LAN IPâs ( as per IETF RFC-1918) are not routable and stay within the confines of your LAN.
Your docker server, running on your host, with âhostâ networking, with have the same IP (LAN IP) address as the host. (whatever the default adapter is)
Maybe it would help if I know what youâre trying to accomplish ?
Settings - Server - Network allows you to tell Plex.tv which âCustom Access URLâ to publish to clients.
With that value set, you could tell Plex.tv to route all client requests to that URL.
( What Plex.tv doesnât know , nor does it care, is what you actually setup behind the scenes for how that server actually exists. Maybe itâs a container, Maybe a VM, Maybe a DMZ (old tech) host. The gain here is you could attach a FQDN to your WAN IP and then publish that FQDN to Plex.
While this makes things clean in one regard, it also means your host can be found by a published FQDN / DNS lookup request.
All of this comes down to:
Why do you want to hide your IP ?
Do you want tighter security ?
Donât you trust the people you are sharing your server with ?
Your post, while informative is also condescending. I fully understand networking and that wan ipâs are not private. lol. And Iâm not doing anything I shouldnât be.
I do have my own domain and dynamic subdomain I have routed to plex but Iâm not using that as a custom url, right now.
Regarding the matter at hand, when I go to https://plex.tv/api/resources?X-Plex-Token=xxx I see the 172.x (docker container), 10.x (docker host) and wan ip. The entry for Wan IP is flagged as local=0. This makes sense: if youâre accessing it via that IP, youâre not on the local network.
The question I have is, why would local clients, on my 10.x network including the server webui itself, be accessing my server via the WANIP instead of the 10.x local ip? As a result, theyâll have everything transcoded, as I would expect for my (truly) external plex clients.
Just because a player is remote does not necessitate transcoding.
Does your firewall/router allow *.plex.direct private domain?
Plex uses its own internal DNS (which is plex.direct) to determine what is and isnât local within the scope of your account.
I had to write an exception rule for pfSense to prevent local containers from being considered remote. (DNS rebinding protection is active in pfsense)
As a test: what happens when you go into Settings - Server - Network and
Treat WAN IP As LAN Bandwidth
Do you still get transcoding ?
I am asking this because treating WAN as LAN will ignore any WAN bandwidth restrictions you might have in place.
If youâre still getting transcoding then the media XML and player settings must be examined. Remember, PMS will always do what is requested by the player and then add any additional system-level liimitations (e.g. Remote streaming bandwidth)
I apologize if I sounded condescending but I never know the skill level of the person Iâm addressing. I attempt to shoot for a middle ground based on whatâs been posted and what Iâve answered in the past. There are many times Iâve done a detailed write-up only to have it sail 50,000 feet above the recipientâs head which is fine but it is just one of those thngs.
I too use pfSense for both firewall and reverse proxy. There could have be an issue resulting from config there. I also started hosting this as a docker container on TrueNAS SCALE, when previously it was proxmox-container-Docker-Plex. Far too many changes around here lately.
I had to write an exception rule for pfSense to prevent local containers from being considered remote. (DNS rebinding protection is active in pfsense)
Can you share the details of this? I suspect it will be custom options on the DNS resolver.
And even though the console logs show it identified as (WAN) tautulli is showing direct-play and LAN beside the client IP
But I was getting transcoding on every file played within the LAN before, which is what led me to the console logs and seeing public ip and âtreating as externalâ leading me to believe the transcoding was all as a result of it thinking my clients were outside. Since I have more bandwidth than CPU resources, I will also set the flag you mentioned; âtreat WAN IP as LAN Bandwidthâ just in case.
So, strangely, this seems resolved. I hate these types of resolutions. I appreciate your insights.
What does so-reuseport: no do and is it necessary/needed?
I only have the first 2 lines from what you show, so wondering if there is a benefit to adding that last line or not?
Chuck, I donât think you understand my question. I know my WAN IP, but Plex is selecting a DIFFERENT IP when I go to Remote Access. I want to manually change it to the CORRECT WAN IP.
12.34.56.77 is the public IPv4 address, replace the decimal points with dashes
1234567890abcdef is your server id
32400 is the TCP port youâve forwarded
This URL gets pushed to the clients when they authenticate with plex.tv, and the plex.direct DNS server will resolve this hostname to IPv4 address 12.34.56.78 , so if port 32400 is open, clients can access.
(fyi, this is also the way to access your server over IPv6, using the v6 address with colons replaced by dashes)
Another way to do it is with your own domain name and a reverse proxy, but thatâs a bit more work.
@ChuckPa Itâs going from a 23.x.x.x address to a 192.168.1.x address. The 23.x is a public IP and is static for my WAN. For some reason PMS keeps trying to use a 67.x.x.x address which seems to be the public IP address of my WISPâs provider.
My WISP recently changed my static IP, it worked perfectly for over 4 years before the change. Itâs not like I donât know how this all works, Iâve been a network engineer since the 80s.