Claiming a Plex Media Server (Docker / Kubernetes)

It was good idea though!

I’m seeing a lot of these error messages in the log:

Apr 28, 2025 18:50:32.131 [140691680197432] WARN - [HttpClient/HCl#28] HTTP error requesting PUT https://plex.tv/devices/d7a16819a3005fbdc8c7015ec0534d3b8004eaa8?Connection[][uri]=https://plex.maas-martin.nl:443&Connection[][uri]=http://10.42.1.20:32400&httpsEnabled=0&httpsRequired=0&dnsRebindingProtection=1&natLoopbackSupported=0&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx (6, Couldn't resolve host name) (Could not resolve host: plex.tv)

But when I try curl from the command line:

root@plex-media-server-0:~/Library/Application Support/Plex Media Server/Logs# curl -vvv plex.tv
*   Trying 52.17.233.89:80...
* TCP_NODELAY set
* Connected to plex.tv (52.17.233.89) port 80 (#0)
> GET / HTTP/1.1
> Host: plex.tv
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 308 Permanent Redirect
< Date: Mon, 28 Apr 2025 19:05:28 GMT
< Content-Type: text/html
< Content-Length: 164
< Connection: keep-alive
< Location: https://plex.tv
< Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
< X-Frame-Options: SAMEORIGIN
< X-XSS-Protection: 1; mode=block
<
<html>
<head><title>308 Permanent Redirect</title></head>
<body>
<center><h1>308 Permanent Redirect</h1></center>
<hr><center>nginx</center>
</body>
</html>
* Connection #0 to host plex.tv left intact

So the docker container is able to resolve the address, but plex itself isn’t ?

I found it!

It’s a bug in plex media server for sure.
Under Kubernetes you need to use fully qualified domain names with at least two dots.
So: plex.tv. and not plex.tv

The second one will fail. Curl worked, because it actually translates the request into plex.tv.

The fix, for me was to use kustomize with the plex helm to add this to the statefulset:

---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: plex-media-server
spec:
  serviceName: plex-media-server
  template:
    spec:
      dnsConfig:
        options:
          - name: ndots
            value: "1"

Yes, it’s the ndots problem: Kubernetes pods /etc/resolv.conf ndots:5 option and why it may negatively affect your application performances

So the good solution is to make plex media server lookup plex.tv. or to add this yaml to the helm chart config.

That’s not a plex problem. It’s a problem with your DNS resolver.

  1. The FQDN endpoint is plex.tv (Domains don’t end with a trailing dot)
  2. Plex’s services are at plex.tv
  3. Plex’s marketing address is www.plex.tv

Notice, none of these end with a second dot.

Except in this case :wink:

Did you see the link, explains it better then I can:

By convention, DNS software consider a name fully qualified if ends with a full stop (.) and non fully qualified otherwise. Ie. google.com. is fully qualified, google.com is not.

And also:

A trailing dot is generally implied and often omitted by most applications.

You can actually type in plex.tv. in your browser and it will work. Because it is the actual FQDN :wink:

p.s. It’s not mine, it’s the default dns from kubernetes. Which is why that yaml config needs to be added to the helm chart. Just to help others in the future.

Fair enough. So Kubernetes has a problem but not Plex.
That’s something those maintainers (Plex doesn’t maintain it there) to manage.

According to the docs, they are following the RFC for DNS.

Also Microsoft: How IT Works: Domain Name System | Microsoft Learn

All DNS records actually end with the period character (.) which represents the root of the DNS hierarchy, but it’s rarely printed and is usually just assumed

We usually call “plex.tv” a FQDN but the actual FQDN is “plex.tv.”. But it’s a bit like “It’s not Linux it’s GNU/Linux” you know what I mean? Pedantic, but software can be pedantic sometimes.

And in this case, it was being silly on us

The terms “Linux” and “GNU/Linux” are often used interchangeably, but there’s a key distinction: Linux is primarily a kernel, while GNU/Linux is the complete operating system built upon the Linux kernel and supplemented with GNU utilities.

I’m using Ubuntu 22.04 Linux :see_no_evil_monkey: lol

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.