I have searched the existing open and closed issues
Required Information
DietPi version 9.8.0
Distro version bookworm
Kernel version Linux DietPi 6.1.0-27-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.115-1 (2024-11-01) x86_64 GNU/Linux
Architecture amd64
SBC model NativePC
Additional Information (if applicable)
Software title docker compose
Hi,
I have an issue with my docker stacks. I host a nginx reverse-proxy on a docker container. I changed the IP address of the host and the stack complains about not reaching internet.
The DNS server of the host is adguard-home manager. Every computer has internet, but somehow this particular docker stack cannot access internet and every containers (4 actually: nginx, authelia, maxmind-geoip, and crowdsec) throw me “error occurred during dial: dial udp: lookup site.tld on 127.0.0.11:53: server misbehaving”
I guess it’s something on the host or on the docker configuration, but I cannot find what or where to search…
Can you please help me?
Hello Joulinar,
First of all, thanks for your reply
Agh isn’t on a container no. It’s on the host.
docker exec cat /etc/resolv.conf nginx
gives:
# Generated by Docker Engine.
# This file can be edited; Docker Engine will not make further changes once it
# has been modified.
nameserver 127.0.0.11
options ndots:0
# Based on host file: '/etc/resolv.conf' (internal resolver)
# ExtServers: [192.168.0.11]
# Overrides: []
# Option ndots from: internal
I tried the same command on other containers, it gives:
root@DietPi:~# docker exec 2e840d196ad6 cat /etc/resolv.conf
nameserver 127.0.0.1
# Generated by Docker Engine.
# This file can be edited; Docker Engine will not make further changes once it
# has been modified.
# Based on host file: '/etc/resolv.conf' (legacy)
# Overrides: []
So I guess modifying 127.0.0.11 to 127.0.0.1 will solve the issue?
But I don’t get why one container gets .1 and the other gets .11. And I don’t know how to modify this…
A setting I do not recommend. The best practice is to use a global public DNS provider like Cloudlfare or Quad9 on the host system that hosts the local AGH/Pihole. Why? What happens if your local DNS server stops working? Your host will lose the ability to resolve its own DNS queries
not sure if this will change anything. Containers normally use the internal Docker DNS server (127.0.0.11) to process DNS queries. If the internal Docker DNS server cannot resolve the request itself, it forwards it to the DNS servers that are configured in the Docker daemon. These DNS servers are usually taken from the host’s /etc/resolv.conf.
But in your case internal Docker DNS server (127.0.0.11) doesn’t seems to be working fine. I gues you already tried to restart Docker/whole system?
Actualy, yes, I even tried to reinstall docker + docker-compose with dietpi-software reinstall. Then uninstalled completely docker, rebooted the host, reinstalled docker, then I recreated stacks from the yaml files. No luck.
Nothing seems to work. So I guess the issue is on the host, but I really don’t know what to check.
theoretically you could try to work around be setting a DNS server within /etc/docker/daemon.json or specifying DNS server dring container start docker run --dns 8.8.8.8 --dns 8.8.4.4 <image-name>
Maybe in addition, check if AGH is LISTEN to all interfaces, allowing Docker to connect.
I’ll give it a try, but I’d rather not, because it used to work. So I must have unintentionally touched something and I’d like to know what
I did change something to docker conf to allow uptime kuma on a distant sbc to connect to docker, but nothing related to DNS?!
Just checked, it is… I don’t understand.
My adguard-home conf is as following:
allowed_clients:
- 192.168.0.0/24 < LAN
- 10.8.0.0/24 < VPN clients
- 127.0.0.1 < Localhost
- 127.0.0.11 < Localhost I guess?
- latitude < laptop
- pixel < android phone
- 10.50.1.2/32 < used to be docker network!!!!!!!
Docker changed (I certaintly did without noticing) its ip range. Now it’s 172.x.x.x. I changed the 10.50.1.X cidr range to 172.x cidr range, and everything works now.
I’m a dumbass.
Thanks Joulinar for the hints. It really helps to exchange ideas and put your problems in writing. I’m glad this community exists
You are right. But I was using portainer previously. (I switched to dockge). And i may have modified the default range.
Yes! My instance is open to the world so I can use adguard home on my phone through DNS over https. So I’m restricting to my clients (pixel and latitude). But when you specify authorized clients the list has to be exhaustive, because that’s a white list.
Why not using the vpn you have installed? Personally I’m using Wireguard split tunnel on my mobile device to just forward DNS request back home. Regular traffic is going via mobile network. This way i don’t need to open my DNS server to the world.
Because on some clients VPN is impossible (at the office for instance) whereas DNS over https is unnoticed.
But you are right, VPN is probably more secure.