Issue/Bug with DNS not being set up inside Docker container

I just resolved an issue that had been stumping me for a few days, and I’m not sure my fix will stick, so I wanted to just raise it here in case it’s a bug, or at the very least to let people know a way to fix it.

I installed Plex on my archlinux server using Docker, following the readme and using the host mode compose template. It built and started fine, listening on the right ports, nothing awry in the logs, etc. But the web interface wouldn’t connect to my server properly on my local domain:32400, the IP:32400 or even with ssh forwarding to localhost:32400. I tried both with and without the claim token, but it didn’t make a difference, so I ended up not using it so I could manually log in to make sure it was working right.

I could open the interface, log in, but depending on the domain/ip would get “not authorized”. The readme says to forward localhost to avoid this, but that worked the least well out of all the options: just loading indefinitely. I was able to access the server via the local IP:32400/web (which I apparently shouldn’t be able to do since I was not using the claim token by this stage?).

Anyways, it finally acknowledged my server existed and started the setup process, but got an “error claiming server” message. When I went to manually claim in the settings page, nothing happened, and a 500 error was being returned in the console with no information. At this point I checked the plex logs to find that it was not able to resolve plex.tv! Which is weird because on my laptop, on the server host, on my phone, etc, I could resolve it fine. But apparently my host DNS settings (which I get from the DHCP server) were not being set up in the container. I added my DNS server manually to the /etc/resolv.conf inside the container using docker exec -ti plex /bin/bash, and it immediately worked!

Not sure why it didn’t automatically pick that up! I am using systemd-networkd/systemd-resolved for my server network manager, using the standard DHCP settings, so it’s not like that’s an unusual network setup. Anyways, it’s all working now.

Hopefully someone can either tell me what I did wrong, or if it is a bug it can be patched!

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