Docker container can't resolve names

56 Views Asked by At

I have a strange problem: in RHEL 8.9 docker compose (v2.24.2), (docker - v25.0.1) runs container created by docker-compose file:

version: '3.4'
services:
  <service>:
    image: <image>
    restart: always
    privileged: true
    environment:
      HTTPS_PROXY: "<HTTPS_PROXY>"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /home/<user>/<folder>/config:/etc/<folder>

At first it works as excpeceted, but then it stop resolve names. resolv.conf file from the container:

docker exec -it <container> cat /etc/resolv.conf
search <domains>
nameserver 127.0.0.11
options rotate attempts:2 timeout:2 ndots:0

The error:

docker exec -it <container> nslookup google.com
;; connection timed out; no servers could be reached

Previously it could resolve the name. Rebooting the docker helps to fix this issue for some time. It also can't ping any server (except the host where it's located).

0

There are 0 best solutions below