5

I'm trying to resolve a docker container address from the host. Windows host. Windows container. I've reviewed number of similar questions:

How do I resolve hostnames to Docker containers from the host?

Docker 1.10 access a container by it's hostname from a host machine

Docker - Windows Container Not Resolving Hosts

None of these questions address this specific question. Seems like a trivial operation and I simply don't understand why it doesn't work.

So for example

$ docker network create -d nat --subnet 172.25.0.0/16 test-net
$ docker container run  --network test-net --name example-1 test/example1

Where test/example1 is simply an asp.net core web server.

So it seems to me I should be able to resolve the container name from the host based on the various clues I see in the above referenced answers. For example

$ nslookup example-1 172.25.0.1
$ nslookup example-1 127.0.0.11
$ nslookup example-1.test-net.docker 127.0.0.11

However nothing works.

Naturally I don't need this capability for production, but it would be very helpful for testing. I simply don't understand why I can't get this to work. What am I missing?

AQuirky
  • 4,691
  • 2
  • 32
  • 51

0 Answers0