Docker Community Forums

Share and learn in the Docker community.

Unable to perform DNS resolution in docker container


(Chilu) #1

Any container that i start is failing to perform nslookup.

I started a centos 6.9 and nslookup is timing out.
;; connection timed out; trying next origin
;; connection timed out; no servers could be reached

The containers are getting resolv.conf file from the host machine as expected.
-bash-4.2$ docker -v
Docker version 1.6.1, build a8a31ef/1.6.1

-bash-4.2$ sudo docker info
Containers: 2
Images: 43
Storage Driver: devicemapper
Pool Name: docker-253:2-425-pool
Pool Blocksize: 65.54 kB
Backing Filesystem: extfs
Data file: /dev/loop0
Metadata file: /dev/loop1
Data Space Used: 2.169 GB
Data Space Total: 107.4 GB
Data Space Available: 6.597 GB
Metadata Space Used: 2.789 MB
Metadata Space Total: 2.147 GB
Metadata Space Available: 2.145 GB
Udev Sync Supported: true
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Library Version: 1.02.140-RHEL7 (2017-05-03)
Execution Driver: native-0.2
Kernel Version: 3.10.0-693.5.2.el7.x86_64
Operating System: Oracle Linux Server 7.4
CPUs: 2
Total Memory: 3.702 GiB
Name: XXXX
ID: VRAP:WPWM:2ZX5:7KZE:U5CE:YZCK:337J:RX6U:EAR6:XJ53:IIAE:PLVA
Username: chilu
Registry: [https://index.docker.io/v1/]


(Sam) #2

what does the container network look like?

can u ping the dns servers? from the container

docker exec (container_id) ping ???


(Chilu) #3

Nope, it not pinging.

[root@0bf7ddd64221 etc]# ping 10.86.x.x
PING 10.86.8.99 (10.86.8.99) 56(84) bytes of data.