Trouble with DNS in Docker Compose #19

Closed
opened 2025-11-19 07:12:01 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @jbcpollak on GitHub (May 2, 2025).

I'm trying to run newt in Docker on my Synology using their Container Manager. I created a docker compose like this:

services:
  newt:
    image: fosrl/newt
    container_name: newt
    restart: unless-stopped
    environment:
      - PANGOLIN_ENDPOINT=https://pangolin.example.tld
      - NEWT_ID=<newt_id>
      - NEWT_SECRET=<secret>

But the logs are full of the following:

ERROR: 2025/05/02 16:09:29 Failed to connect: failed to get token: failed to request new token: Post "https://pangolin.example.tld/api/v1/auth/newt/get-token": dial tcp: lookup pangolin.example.tld on 127.0.0.11:53: server misbehaving. Retrying in 10s...

When I run docker exec -it newt nslookup pangolin.example.tld I get a similar error:

:~$ sudo docker exec -it newt /bin/sh
/ # nslookup pangolin.example.tld
Server:		127.0.0.11
Address:	127.0.0.11:53

;; connection timed out; no servers could be reached

/ # cat /etc/resolv.conf 
nameserver 127.0.0.11
options ndots:0

I'm not sure if this is a problem with the container image - maybe its a problem with Docker or the Synology Docker setup, but I wanted to ask if there anyone has any insight into this problem.

TIA.

Originally created by @jbcpollak on GitHub (May 2, 2025). I'm trying to run newt in Docker on my Synology using their Container Manager. I created a docker compose like this: ``` services: newt: image: fosrl/newt container_name: newt restart: unless-stopped environment: - PANGOLIN_ENDPOINT=https://pangolin.example.tld - NEWT_ID=<newt_id> - NEWT_SECRET=<secret> ``` But the logs are full of the following: ``` ERROR: 2025/05/02 16:09:29 Failed to connect: failed to get token: failed to request new token: Post "https://pangolin.example.tld/api/v1/auth/newt/get-token": dial tcp: lookup pangolin.example.tld on 127.0.0.11:53: server misbehaving. Retrying in 10s... ``` When I run `docker exec -it newt nslookup pangolin.example.tld` I get a similar error: ``` :~$ sudo docker exec -it newt /bin/sh / # nslookup pangolin.example.tld Server: 127.0.0.11 Address: 127.0.0.11:53 ;; connection timed out; no servers could be reached / # cat /etc/resolv.conf nameserver 127.0.0.11 options ndots:0 ``` I'm not sure if this is a problem with the container image - maybe its a problem with Docker or the Synology Docker setup, but I wanted to ask if there anyone has any insight into this problem. TIA.
Author
Owner

@oschwartz10612 commented on GitHub (May 3, 2025):

Strange. Certainly seems for some reason it does not like the DNS. I cant fully tell you why this is occurring on Synology but what you could try is using the DNS env var to specify a DNS and see if that helps. Let me know if it does or not.

@oschwartz10612 commented on GitHub (May 3, 2025): Strange. Certainly seems for some reason it does not like the DNS. I cant fully tell you why this is occurring on Synology but what you could try is using the DNS env var to specify a DNS and see if that helps. Let me know if it does or not.
Author
Owner

@jbcpollak commented on GitHub (May 4, 2025):

I tried setting DNS to 8.8.8.8 and 192.168.1.1 (my router) and in both cases I got the same error as above. literally the same - the ip address of the server mentioned above didn't change. Which is very strange. And I did verify the container was rebuilt and running with the correct config. Its very strange.

services:
  newt:
    image: fosrl/newt
    container_name: newt
    restart: unless-stopped
    environment:
      - PANGOLIN_ENDPOINT=https://pangolin.example.tld
      - NEWT_ID=<newt_id>
      - NEWT_SECRET=<secret>
      - DNS=8.8.8.8
@jbcpollak commented on GitHub (May 4, 2025): I tried setting DNS to 8.8.8.8 and 192.168.1.1 (my router) and in both cases I got the same error as above. _literally_ the same - the ip address of the server mentioned above didn't change. Which is very strange. And I did verify the container was rebuilt and running with the correct config. Its very strange. ``` services: newt: image: fosrl/newt container_name: newt restart: unless-stopped environment: - PANGOLIN_ENDPOINT=https://pangolin.example.tld - NEWT_ID=<newt_id> - NEWT_SECRET=<secret> - DNS=8.8.8.8 ```
Author
Owner

@jbcpollak commented on GitHub (May 4, 2025):

Ok, I got it working - for anyone in the future, the problem was using the docker-compose YAML as a "Project" in the Synology Container Manager. I assume this is because it does something "interesting" with the network, and the non-default network has non-standard bridge settings.

Since Newt runs alone and doesn't really need a docker compose file, I just deleted the Project and switched to the Container tab, then set Newt up as a single container with the default "bridge" network. This worked immediately.

@jbcpollak commented on GitHub (May 4, 2025): Ok, I got it working - for anyone in the future, the problem was using the docker-compose YAML as a "Project" in the Synology Container Manager. I assume this is because it does something "interesting" with the network, and the non-default network has non-standard bridge settings. Since Newt runs alone and doesn't really need a docker compose file, I just deleted the Project and switched to the Container tab, then set Newt up as a single container with the default "bridge" network. This worked immediately.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/newt#19