I am new to docker/container. I noticed that my container cannot ping local FQDN at all. My containers are using the default/bridge network. I am using busybox image for this troubleshooting right now.
In container.
Ping FQDN results
Ping: Bad Address “FQDN”
Could depend on the fqdn. If the container says bad address, I assume it is a special fqdn which is not accepted by the ping command in the busybox container. Try an ubuntu container, or nicolaka/nethsoot, or share how you installed Docker Exctly.
Docker is installed using the newest instruction from the docker website for ubuntu 24.
I tested on the ubuntu container with the same behavior. It is just a simple docker run -it ubuntu.
The /etc/resolv.conf in both the docker host and the container has search mytopleveld.domain in there. Maybe somehow that is related?
The resolv.conf is copied from your host (/run/systemd/resolv/resolv.conf) unless you are using a custom docker network which is also created by docker compose.
You added the docker-compose tag to the topic, but you don’t mention compose in your post… On the other hand, you write you just use a simple docker run command using ubuntu, but ubuntu has no ping command by default, unless you install it first. So is there any other detail missing from the instructions to reproduce the issue?
Since my last post, I realized that ping in a busybox container returns bad address when the domain is not resolvable, but ubuntu returns a different error since the ping package is different too. So please, don’t leave out any detail so we can figure out what the issue is exactly.
Please, share a link. There are multiple instructions for different kind of Docker variants.
Also please, share the output of the following command
Here is more info.
Docker installation using apt in this link:
dpkg -l | grep docker result
ii docker-ce 5:27.3.1-1~ubuntu.24.04~noble amd64 Docker: the open-source application container engine
ii docker-ce-cli 5:27.3.1-1~ubuntu.24.04~noble amd64 Docker CLI: the open-source application container engine
ii docker-ce-rootless-extras 5:27.3.1-1~ubuntu.24.04~noble amd64 Rootless support for Docker.
ii docker-compose 1.29.2-6ubuntu1 all define and run multi-container Docker applications with YAML
ii docker-compose-plugin 2.29.7-1~ubuntu.24.04~noble amd64 Docker Compose (V2) plugin for the Docker CLI.
rc docker.io 24.0.7-0ubuntu4.1 amd64 Linux container runtime
ii python3-compose 1.29.2-6ubuntu1 all Python implementation of docker-compose file specification
ii python3-docker 5.0.3-1ubuntu1.1 all Python 3 wrapper to access docker.io's control socket
ii python3-dockerpty 0.4.1-5 all Pseudo-tty handler for docker Python client (Python 3.x)
Yep, those are user defined network with default values, which get created during deployment of a docker compose project. Containers attached to user defined networks use docker’s built-in dns server on 127.0.0.11 (like seen in your example), which uses the nameservers configured in /etc/resolv.conf as upstream servers.
We are talking about docker compose deployments, and not docker stack deploy deployments, right?
Can you share the output of docker network inspect <name of the network> ?
You could try to disable ipv6 specifically by adding those lines to your compose file:
networks:
default:
enable_ipv6: false
Make sure to run docker compose down before a docker compose up -d, in order to delete the existing network, so it can be recreated using the new configuration. Networks are immutable → they will not be updated in-place.
This shows you are still using docker-compose commands not docker compose. I have no idea if the old compose has anything to do with your issue (probably not, since the error happened without compose as well) , but you should definitely stop using an already discontinued compose version.
And if Docker was really
The docker-compose package should have been uninstalled as the very first command in the documentation includes uninstalling docker.io and also docker-compose among other packages.