Docker Community Forums

Share and learn in the Docker community.

Publish to virtual IP alias

I administer multiple BIND master / slave servers for the LAN network. These are currently each on dedicated servers, and all hosts use it for DNS. I would like to dockerize them on a single Docker server and consolidate resources better. Since I cannot publish multiple containers to the same port 53/udp, I thought about adding multiple virtual alias (eth0:0, eth0:1, eth0:2 etc) each with static IPs, and publishing 53/udp on each container to each of the virtual aliases. Essentially:


The Docker server will be Linux (probably Arch Linux), but I am prototyping on a Windows laptop. I am thinking of using Alpine for the BIND containers. I added multiple IPs to my Ethernet connection (Network Connections -> [connection] -> IPv4 -> Advanced -> IP address -> Add…) I can ping these additional IPs from other PCs on the network. However, when I try to run try to publish to this IP it fails as below. Should this scenario work, and if so what am I missing? It works fine if I remove the IP address, but that would mean that I could no longer run multiple DNS slave containers which negates the requirements. Comments appreciated. Thank you.


Pinging with 32 bytes of data:
Reply from bytes=32 time<1ms TTL=128
Reply from bytes=32 time<1ms TTL=128
Reply from bytes=32 time<1ms TTL=128
Reply from bytes=32 time<1ms TTL=128

Ping statistics for
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:>docker container ls -a

C:>docker run -d --name bind -p alpine
docker: Error response from daemon: driver failed programming external connectivity on endpoint bind (76aa68c4f15c54bfc895f928a9860aed3aff8042f28b49b9715a21d662d03ea9): Error starting userland proxy: listen udp bind: cannot assign requested address.


A published port can only be bound to an ip on linux.

Hi @meyay. Perhaps I was not being clear; my apologies.
On my Docker server I have multiple IP addresses available:,,… I am trying to bind a single container port to a single IP address, then another container port to another IP address. Unfortunately, this does not seem to be working. What can I do to make this?

You have been clear on your first post and this example looks correct:

This should work:

docker run -d --name bind1 -p alpine
docker run -d --name bind2 -p alpine
docker run -d --name bind3 -p alpine
docker run -d --name bind4 -p alpine

Though, neither on Windows, nor on MacOS. You are simply using the wrong plattform to perform your tests. This is what my last post was about…

1 Like

Thank you @meyay. I was not away of this difference. I’ll setup a Linux box to continue prototyping.
Much appreciated.