DNS Docker Fedora – Unable to Resolve Any Name Inside Docker Containers

dockerdomain-name-systemfedora

im on Fedora 34 (= host system) and i have a problem within my docker containers not resolving any domain.
On the host resolution works without problems.

Here's what i tried:

  • restart & reinstall docker
  • disable firewall
  • restart machine
  • restart dns
  • different docker images
  • explicitly setting dns in docker (see below)
  • using network mode in docker (see below)
  • disabling ipv6

However, i cannot get a name resolved in any container:

~ docker run busybox nslookup google.com 
Server:     8.8.8.8
Address:    8.8.8.8:53

Non-authoritative answer:
Name:   google.com
Address: 142.251.36.174

*** Can't find google.com: No answer

As described, it works on the host:

~ nslookup google.com
Server:     127.0.0.53
Address:    127.0.0.53#53

Non-authoritative answer:
Name:   google.com
Address: 142.251.36.206
Name:   google.com
Address: 2a00:1450:4016:809::200e

What's also weird, even running with the hosts network or explicitly setting the dns doesn't help:

Tried setting with hosts dns (here it even says timed out…)

~ docker run --dns 127.0.0.53 busybox nslookup google.com
;; connection timed out; no servers could be reached

Tried with google dns:

~ docker run --dns 8.8.8.8 busybox nslookup google.com
Server:     8.8.8.8
Address:    8.8.8.8:53

Non-authoritative answer:
Name:   google.com
Address: 142.251.36.238

*** Can't find google.com: No answer

Tried with host network:

 ~ docker run --network="host" busybox nslookup google.com
Server:     8.8.8.8
Address:    8.8.8.8:53

Non-authoritative answer:
Name:   google.com
Address: 142.251.36.238

*** Can't find google.com: No answer

Im running out of ideas..anyone has a hint, what's going on here?

Additional information: It used to work, i didn't change anything on my system as far as i remember that could have an impact on that.

Best Answer

Can you try running the nslookup command with a DNS server specified? As in: nslookup google.com 8.8.8.8, or in your case: docker run busybox nslookup google.com 8.8.8.8. This will help us to eliminate possible network issues in the Docker bridge.