Kevin
Kevin

Reputation: 1569

Can not resolve hostname in Docker 1.10

I created a network and started 2 containers in the network

docker network create frontend
docker run -itd --name container1 --net frontend busybox
docker run -itd --name container2 --net frontend busybox

2 containers ping each other by ipaddress successfully but can not use hostname. In Docker 1.9, I can use both ipaddress and hostname but can not use hostname in Docker 1.10

docker exec container1 ping -c4 172.18.0.3 --> OK
docker exec container2 ping -c4 172.18.0.2 --> OK

docker exec container1 ping -c4 container2 --> FAILED
ping: bad address 'container2'

docker exec container2 ping -c4 container1 --> FAILED
ping: bad address 'container1'

How can I fix this problem? Thank you!

Upvotes: 2

Views: 1157

Answers (1)

Kevin
Kevin

Reputation: 1569

It seems Docker 1.10 Embedded DNS have trouble with selinux and firewalld on Fedora, RHEL and CentOS 7. You can work around by disabling selinux and firewalld. Hope Docker team can fix this issue soon!


Update: Docker 1.10.1 has fixed this problem! It works perfectly on Fedora 23, CentOS 7 and RHEL 7

Upvotes: 1

Related Questions