Skip to content

DNS Not Resolving under Network [CentOS8] #957

Closed
moby/moby
#41189
@arpadgabor

Description

@arpadgabor

Edit: There's a workaround in the comments below.

Ok so I have a fresh install of CentOS8, Docker, Docker compose. I'm trying to run Traefik. Created my network with docker create network proxy, attached it to my docker-compose file, ran my scripts, and it works. Kinda.

If I run a container with --net=host everything works fine. However, any other network I create does not resolve DNS


  • This is a bug report
  • This is a feature request
  • I searched existing issues before opening this one (yeah it's like 4AM already)

Expected behavior

$ docker exec -it traefik ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: seq=0 ttl=55 time=3.983 ms
64 bytes from 1.1.1.1: seq=1 ttl=55 time=4.077 ms
^C
--- 1.1.1.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 3.983/4.030/4.077 ms

Actual behavior

I repeat: If I run a container with --net=host everything works fine. However, any other network I create does not resolve DNS

$ docker exec -it traefik ping google.com
ping: bad address 'google.com

Steps to reproduce the behavior

I'm running a CentOS 8 VPS on Hetzner Cloud with the latest version of Docker (as of yesterday). The issue just "happened".

$ docker-compose -v
docker-compose version 1.25.4, build 8d51620a

Output of docker version:

$ docker -v
Docker version 19.03.8, build afacb8b

Output of docker info:

Client:
 Debug Mode: false

Server:
 Containers: 5
  Running: 1
  Paused: 0
  Stopped: 4
 Images: 1
 Server Version: 18.09.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: c4446665cb9c30056f4998ed953e6d4ff22c7c39
 runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.18.0-80.11.2.el8_0.x86_64
 Operating System: CentOS Linux 8 (Core)
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 3.755GiB
 Name: centos-4gb-nuremberg
 ID: DUXL:2E6W:WKB3:CWRG:7BUY:4VIN:YMXX:FRTH:L7YK:L5LY:X3D4:Y52L
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine

Additional environment details (AWS, VirtualBox, physical, etc.)

Hetzner Cloud

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions