Yes, I would not have posted the solution I did if I did not show I could break and fix Plex with it.
When there is no nameserver in /etc/resolv.conf (resolv.conf mode: foreign
, the state in which I made my initial post) or no /etc/resolv.conf file or symlink at all, which gives resolv.conf mode: missing
, the behavior is as below: ping
, curl
, and wget
resolve domain names; dig
, nslookup
, and Plex v1.23.2.4656-85f0adf5b fail to resolve plex.tv.
$ sudo unlink /etc/resolv.conf
$ cat /etc/resolv.conf
# Resolver configuration file.
# See resolv.conf(5) for details.
# nameserver 1.1.1.1 8.8.8.8 9.9.9.10
$ ls -la /etc/resolv.conf
-rw-r--r-- 1 root root 103 Jun 13 23:57 /etc/resolv.conf
$ sudo systemctl restart systemd-resolved
$ sudo resolvectl status
Global
Protocols: +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: foreign
DNS Servers: 1.1.1.1
Fallback DNS Servers: 9.9.9.10 8.8.8.8 1.0.0.1 8.8.4.4 2001:4860:4860::8888 2606:4700:4700::1111 2606:4700:4700::1001
Link 2 (eno1)
Current Scopes: LLMNR/IPv6
Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Link 3 (br0)
Current Scopes: LLMNR/IPv4 LLMNR/IPv6
Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
$ curl plex.tv
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
# plex.tv doesn't answer pings so I went with www.plex.tv
$ ping -c 5 www.plex.tv
PING www.plex.tv (104.18.13.47) 56(84) bytes of data.
64 bytes from 104.18.13.47 (104.18.13.47): icmp_seq=1 ttl=59 time=7.21 ms
64 bytes from 104.18.13.47 (104.18.13.47): icmp_seq=2 ttl=59 time=7.62 ms
64 bytes from 104.18.13.47 (104.18.13.47): icmp_seq=3 ttl=59 time=7.21 ms
64 bytes from 104.18.13.47 (104.18.13.47): icmp_seq=4 ttl=59 time=7.50 ms
64 bytes from 104.18.13.47 (104.18.13.47): icmp_seq=5 ttl=59 time=6.45 ms
--- www.plex.tv ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 6.451/7.198/7.620/0.406 ms
$ wget plex.tv
--2021-06-14 00:01:08-- http://plex.tv/
Resolving plex.tv (plex.tv)... 99.81.153.144, 108.128.10.254, 99.81.164.127
Connecting to plex.tv (plex.tv)|99.81.153.144|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://plex.tv/ [following]
--2021-06-14 00:01:08-- https://plex.tv/
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Connecting to plex.tv (plex.tv)|99.81.153.144|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://www.plex.tv/ [following]
--2021-06-14 00:01:08-- https://www.plex.tv/
Resolving www.plex.tv (www.plex.tv)... 104.18.12.47, 104.18.13.47, 2606:4700::6812:c2f, ...
Connecting to www.plex.tv (www.plex.tv)|104.18.12.47|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: âindex.html.2â
index.html.2 [ <=> ] 234.08K --.-KB/s in 0.02s
2021-06-14 00:01:08 (10.7 MB/s) - âindex.html.2â saved [239697]
$ dig plex.tv
; <<>> DiG 9.16.16 <<>> plex.tv
;; global options: +cmd
;; connection timed out; no servers could be reached
$ nslookup plex.tv
;; connection timed out; no servers could be reached
$ sudo systemctl stop plexmediaserver
$ sudo rm /var/log/plex/Plex\ Media\ Server.log
$ sudo systemctl start plexmediaserver
$ cat /var/log/plex/Plex\ Media\ Server.log | grep -e WARN -e ERROR
Jun 14, 2021 00:03:04.576 [0x7fa8630eab38] ERROR - [MediaProviderManager] Error issuing curl_easy_perform(handle): 6
Jun 14, 2021 00:03:04.576 [0x7fa8630eab38] WARN - [MediaProviderManager] HTTP error requesting GET https://plex.tv/media/providers?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx (6, Couldn't resolve host name) (Could not resolve host: plex.tv)
Jun 14, 2021 00:03:04.576 [0x7fa8630eab38] ERROR - [MediaProviderManager] Error parsing content.
Jun 14, 2021 00:03:04.576 [0x7fa8630eab38] ERROR - [MediaProviderManager] Error parsing XML: Error parsing file.
Jun 14, 2021 00:03:04.580 [0x7fa862e17b38] ERROR - Error issuing curl_easy_perform(handle): 6
Jun 14, 2021 00:03:04.580 [0x7fa862e17b38] WARN - HTTP error requesting GET https://plex.tv/api/v2/server/access_tokens?auth_token=xxxxxxxxxxxxxxxxxxxx (6, Couldn't resolve host name) (Could not resolve host: plex.tv)
Jun 14, 2021 00:03:05.829 [0x7fa86295fb38] ERROR - getaddrinfo(192-168-1-69.abcdefghijklmnopqrstuvwxyz012345.plex.direct) failed: -3
Jun 14, 2021 00:03:05.829 [0x7fa862b44b38] ERROR - Error issuing curl_easy_perform(handle): 6
Jun 14, 2021 00:03:05.829 [0x7fa862b44b38] WARN - HTTP error requesting GET https://plex.tv/api/v2/user?includeSubscriptions=1&includeProviders=1 (6, Couldn't resolve host name) (Could not resolve host: plex.tv)
Jun 14, 2021 00:03:05.829 [0x7fa862b8ab38] ERROR - Error issuing curl_easy_perform(handle): 6
Jun 14, 2021 00:03:05.829 [0x7fa862b8ab38] WARN - HTTP error requesting GET http://plex.tv/pms/:/ip (6, Couldn't resolve host name) (Could not resolve host: plex.tv)
Jun 14, 2021 00:03:05.830 [0x7fa862b8ab38] ERROR - PublicAddressManager: Unable to get public IP adddress from myPlex (httpCode=-6):
Jun 14, 2021 00:03:09.582 [0x7fa8630eab38] ERROR - [MediaProviderManager] Error issuing curl_easy_perform(handle): 6
Jun 14, 2021 00:03:09.582 [0x7fa8630eab38] WARN - [MediaProviderManager] HTTP error requesting GET https://plex.tv/media/providers?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx (6, Couldn't resolve host name) (Could not resolve host: plex.tv)
Jun 14, 2021 00:03:09.582 [0x7fa8630eab38] ERROR - [MediaProviderManager] Error parsing content.
Jun 14, 2021 00:03:09.582 [0x7fa8630eab38] ERROR - [MediaProviderManager] Error parsing XML: Error parsing file.
Jun 14, 2021 00:03:09.590 [0x7fa862e17b38] ERROR - Error issuing curl_easy_perform(handle): 6
Jun 14, 2021 00:03:09.590 [0x7fa862e17b38] WARN - HTTP error requesting GET https://plex.tv/api/v2/server/users?auth_token=xxxxxxxxxxxxxxxxxxxx (6, Couldn't resolve host name) (Could not resolve host: plex.tv)
Jun 14, 2021 00:03:10.838 [0x7fa862b8ab38] ERROR - Error issuing curl_easy_perform(handle): 6
The behavior after putting a DNS server IP into /etc/resolv.conf
(resolv.conf mode: uplink
if it is a symlink like in the example below, resolv.conf mode: foreign
if it is just a file, but still fixes DNS issues): ping
, curl
, and wget
are the same; dig
, nslookup
, and Plex v1.23.2.4656-85f0adf5b now have DNS resolution.
$ sudo ln -snf /run/systemd/resolve/resolv.conf /etc/resolv.conf
$ cat /etc/resolv.conf
# This is /run/systemd/resolve/resolv.conf managed by man:systemd-resolved(8).
# Do not edit.
#
# This file might be symlinked as /etc/resolv.conf. If you're looking at
# /etc/resolv.conf and seeing this text, you have followed the symlink.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known uplink DNS servers. This file lists all configured search domains.
#
# Third party programs should typically not access this file directly, but only
# through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a
# different way, replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 1.1.1.1
search .
$ ls -la /etc/resolv.conf
lrwxrwxrwx 1 root root 32 Jun 14 00:10 /etc/resolv.conf -> /run/systemd/resolve/resolv.conf
$ sudo systemctl restart systemd-resolved
$ sudo resolvectl status
Global
Protocols: +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: uplink
DNS Servers: 1.1.1.1
Fallback DNS Servers: 9.9.9.10 8.8.8.8 1.0.0.1 8.8.4.4 2001:4860:4860::8888 2606:4700:4700::1111 2606:4700:4700::1001
Link 2 (eno1)
Current Scopes: LLMNR/IPv6
Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Link 3 (br0)
Current Scopes: LLMNR/IPv4 LLMNR/IPv6
Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
$ curl plex.tv
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
$ ping -c 5 www.plex.tv
PING www.plex.tv (104.18.12.47) 56(84) bytes of data.
64 bytes from 104.18.12.47 (104.18.12.47): icmp_seq=1 ttl=59 time=6.14 ms
64 bytes from 104.18.12.47 (104.18.12.47): icmp_seq=2 ttl=59 time=6.73 ms
64 bytes from 104.18.12.47 (104.18.12.47): icmp_seq=3 ttl=59 time=5.60 ms
64 bytes from 104.18.12.47 (104.18.12.47): icmp_seq=4 ttl=59 time=5.94 ms
64 bytes from 104.18.12.47 (104.18.12.47): icmp_seq=5 ttl=59 time=5.68 ms
--- www.plex.tv ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 5.603/6.021/6.733/0.404 ms
$ wget plex.tv
--2021-06-14 00:17:48-- http://plex.tv/
Resolving plex.tv (plex.tv)... 99.81.164.127, 108.128.10.254, 99.81.153.144
Connecting to plex.tv (plex.tv)|99.81.164.127|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://plex.tv/ [following]
--2021-06-14 00:17:48-- https://plex.tv/
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Connecting to plex.tv (plex.tv)|99.81.164.127|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://www.plex.tv/ [following]
--2021-06-14 00:17:49-- https://www.plex.tv/
Resolving www.plex.tv (www.plex.tv)... 104.18.13.47, 104.18.12.47, 2606:4700::6812:d2f, ...
Connecting to www.plex.tv (www.plex.tv)|104.18.13.47|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: âindex.html.3â
index.html.3 [ <=> ] 234.08K --.-KB/s in 0.03s
2021-06-14 00:17:49 (7.58 MB/s) - âindex.html.3â saved [239697]
$ dig plex.tv
; <<>> DiG 9.16.16 <<>> plex.tv
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38438
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;plex.tv. IN A
;; ANSWER SECTION:
plex.tv. 38 IN A 99.81.153.144
plex.tv. 38 IN A 99.81.164.127
plex.tv. 38 IN A 108.128.10.254
;; Query time: 10 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Mon Jun 14 00:18:04 EDT 2021
;; MSG SIZE rcvd: 84
$ nslookup plex.tv
Server: 1.1.1.1
Address: 1.1.1.1#53
Non-authoritative answer:
Name: plex.tv
Address: 108.128.10.254
Name: plex.tv
Address: 99.81.153.144
Name: plex.tv
Address: 99.81.164.127
$ sudo systemctl stop plexmediaserver
$ sudo rm /var/log/plex/Plex\ Media\ Server.log
$ sudo systemctl start plexmediaserver
$ cat /var/log/plex/Plex\ Media\ Server.log | grep -e WARN -e ERROR
Jun 14, 2021 00:19:00.364 [0x7f40e7f4bb38] WARN - [MediaProviderManager] Unrecognized MediaProvider feature: availability
Jun 14, 2021 00:19:00.364 [0x7f40e7f4bb38] WARN - [MediaProviderManager] Unrecognized MediaProvider feature: availability-platforms
Jun 14, 2021 00:19:00.364 [0x7f40e7f4bb38] WARN - [MediaProviderManager] Unrecognized MediaProvider feature: universalSearch
Jun 14, 2021 00:19:00.368 [0x7f40e8073b38] WARN - [MediaProviderManager] Unrecognized MediaProvider feature: availability
Jun 14, 2021 00:19:00.368 [0x7f40e8073b38] WARN - [MediaProviderManager] Unrecognized MediaProvider feature: availability-platforms
Jun 14, 2021 00:19:00.368 [0x7f40e8073b38] WARN - [MediaProviderManager] Unrecognized MediaProvider feature: universalSearch
Jun 14, 2021 00:19:01.034 [0x7f40e75b5b38] ERROR - Unable to find client profile for device; platform=Xbox, platformVersion=10.0.19041.7772, device=Xbox, model=Xbox One
Jun 14, 2021 00:19:01.034 [0x7f40e75b5b38] WARN - [Analytics] Attempting to send unrecognized metric (playback:server:itemstart). Skipping.
Jun 14, 2021 00:19:01.787 [0x7f40e8202b38] WARN - MyPlex: attempted a reachability check but we're not yet mapped.
Jun 14, 2021 00:19:01.817 [0x7f40e781cb38] WARN - Sync: Couldn't get sync lists without subscription.