Docker Community Forums

Share and learn in the Docker community.

No dns inside container

i run docker 20.10.5 in rootless-mode on a debian 10 host.
i use systemd-resolved to do nameresolution and this is well configured and working.
but i cannot resolv hosts inside docker containers.

the /etc/resolv.conf inside containers looks like:

nameserver 2a02:c205:0:0882::1
nameserver 2a02:c205:0:0891::1
options ndots:0

i can fix the issue by overwriting the /etc/resolv.conf with


and all works fine.
but this cant be the proper solution. what is wrong here?
i already tried to start the containers with --dns ‘’ or configured this in the daemon.json. but this didn’t helped.
it looks like the dns is not properly forwarded to the docker-daemon/host.

what also looks strange … i have no chain in iptables for docker. shouldn’t be one there?

could someone help me
thank you

// EDIT1:
some additional information. i switched on my host between systemd-resolved.service and resolvconf.service … no differences.
if the resolv.conf inside a container look like this:

options ndots:0

nslookup fail… if it look like this:

options ndots:0

it success, but then there is no dns between container names possible anymore

SUre I agree here, How are you guys today?