I have a Docker 1.10.2 swarm cluster running an overlay network. When I add containers to the network their DNS names only resolve if they are the correct case as the hostname or network alias set for the container. DNS names are supposed to be case insensitive (RFC 4343).
Steps to Reproduce: start a simple container on a network:
docker network create -d overlay foonet
docker run -d --name=web nginx
docker network connect --alias=webalias foonet web
Then start a busybox container on the same network - pings and nslookups using lowercase host names and aliases are successful.
~$ docker run -it --rm=true --net foonet busybox
/ # ping -w 1 web
PING web (10.0.6.2): 56 data bytes
64 bytes from 10.0.6.2: seq=0 ttl=64 time=0.108 ms
--- web ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.108/0.108/0.108 ms
/ # ping -w 1 webalias
PING webalias (10.0.6.2): 56 data bytes
64 bytes from 10.0.6.2: seq=0 ttl=64 time=0.070 ms
--- webalias ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.070/0.070/0.070 ms
/ # nslookup web
Server: 127.0.0.11
Address 1: 127.0.0.11
Name: web
Address 1: 10.0.6.2 web.foonet
/ # nslookup webalias
Server: 127.0.0.11
Address 1: 127.0.0.11
Name: webalias
Address 1: 10.0.6.2 web.foonet
Actual Behavior: Pings and nslookups using UPPERCASE names fail host name lookup.
~$ docker run -it --rm=true --net foonet busybox
/ # ping -w 1 WEB
ping: bad address 'WEB'
/ # ping -w 1 WEBALIAS
ping: bad address 'WEBALIAS'
/ # nslookup WEB
Server: 127.0.0.11
Address 1: 127.0.0.11
nslookup: can't resolve 'WEB'
/ # nslookup WEBALIAS
Server: 127.0.0.11
Address 1: 127.0.0.11
nslookup: can't resolve 'WEBALIAS'
Expected Behavior: pings using UPPERCASE host names (or aliases) resolve to the same IP as lowercase host names.
Additional Info
Docker Info (Mgr Host):
~$ docker info
Containers: 15
Running: 15
Paused: 0
Stopped: 0
Images: 84
Server Version: 1.10.2
Storage Driver: aufs
Root Dir: /mnt/docker/aufs
Backing Filesystem: extfs
Dirs: 1094
Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Plugins:
Volume: local
Network: overlay null host bridge
Kernel Version: 4.2.0-30-generic
Operating System: Ubuntu 15.10
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 29.96 GiB
Name: mgr
ID: UU6C:7S52:I6RG:KKUR:NIM6:KV62:ZMUL:B64N:H7IB:MEXF:IBKL:4Z54
Labels: NodeType=frontend
Cluster store: consul://mgr:8500/swarm/mgr
Cluster advertise: 172.31.1.85:2375
Docker info (Swarm Mgr)
$ docker -H=localhost:3375 info
Containers: 43
Running: 43
Paused: 0
Stopped: 0
Images: 117
Server Version: swarm/1.1.3
Role: primary
Strategy: spread
Filters: health, port, dependency, affinity, constraint
Nodes: 3
mgr: mgr:2375
โ Status: Healthy
โ Containers: 15
โ Reserved CPUs: 0 / 4
โ Reserved Memory: 3 GiB / 31.46 GiB
โ Labels: NodeType=frontend, executiondriver=native-0.2, kernelversion=4.2.0-30-generic, operatingsystem=Ubuntu 15.10, storagedriver=aufs
โ Error: (none)
โ UpdatedAt: 2016-03-07T20:28:11Z
node01: node01:2375
โ Status: Healthy
โ Containers: 14
โ Reserved CPUs: 0 / 4
โ Reserved Memory: 3 GiB / 31.46 GiB
โ Labels: NodeType=backend, executiondriver=native-0.2, kernelversion=4.2.0-30-generic, operatingsystem=Ubuntu 15.10, storagedriver=aufs
โ Error: (none)
โ UpdatedAt: 2016-03-07T20:28:23Z
node02: node02:2375
โ Status: Healthy
โ Containers: 14
โ Reserved CPUs: 0 / 4
โ Reserved Memory: 3 GiB / 31.46 GiB
โ Labels: NodeType=backend, executiondriver=native-0.2, kernelversion=4.2.0-30-generic, operatingsystem=Ubuntu 15.10, storagedriver=aufs
โ Error: (none)
โ UpdatedAt: 2016-03-07T20:28:21Z
Plugins:
Volume:
Network:
Kernel Version: 4.2.0-30-generic
Operating System: linux
Architecture: amd64
CPUs: 12
Total Memory: 94.37 GiB
Name: mgr
Docker version
~$ docker version
Client:
Version: 1.10.2
API version: 1.22
Go version: go1.5.3
Git commit: c3959b1
Built: Mon Feb 22 21:40:35 2016
OS/Arch: linux/amd64
Server:
Version: 1.10.2
API version: 1.22
Go version: go1.5.3
Git commit: c3959b1
Built: Mon Feb 22 21:40:35 2016
OS/Arch: linux/amd64
~$ docker -H=localhost:3375 version
Client:
Version: 1.10.2
API version: 1.22
Go version: go1.5.3
Git commit: c3959b1
Built: Mon Feb 22 21:40:35 2016
OS/Arch: linux/amd64
Server:
Version: swarm/1.1.3
API version: 1.22
Go version: go1.5.3
Git commit: 7e9c6bd
Built: Wed Mar 2 00:15:12 UTC 2016
OS/Arch: linux/amd64
Deamon startup settings
~$ cat /etc/systemd/system/docker.service.d/mgr.conf
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon --cluster-store=consul://mgr:8500/swarm/mgr --cluster-advertise=eth0:2375 -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --label NodeType="frontend"
Linux info
~$ uname -a
Linux mgr 4.2.0-30-generic #36-Ubuntu SMP Fri Feb 26 00:58:07 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Environment
AWS - EC2 - using stock Ubuntu 15.10 image (AMI #ami-242fcb44).
This was also recently logged by someone else in the Docker issues list: docker/docker#21169
@tfasz It has been detected that this issue has not received any activity in over 6 months. Can you please let us know if it is still relevant:
Thank you!
This issue will be automatically closed in 1 week unless it is commented on.
For more information please refer to https://github.com/docker/libnetwork/issues/1926
@GordonTheTurtle I believe that this is still a relevant issue. We are seeing it on Ubuntu 16.04 LTS, with Docker version 17.12.0-ce, build c97c6d6. A hostname FOO cannot be resolved with foo.
Yes it is still a relevant issue / bug as of today with Docker 18.03.1-ce-win65 (17513).
Hostname resolution should be case insensitive.
Most helpful comment
Yes it is still a relevant issue / bug as of today with Docker 18.03.1-ce-win65 (17513).
Hostname resolution should be case insensitive.