Docker Community Forums

Share and learn in the Docker community.

ddDNS server in user-defined networksDNS server in user-defined networksdd


(Saffik) #1

Hello,

I am using docker compose to create my docker containers:

docker-compose --file example.yml up

This will create a number of containers and pull images etc…
Now Imagine I have a bunch of servers there:
E.g.
Server-A
Server-B
Server-C
Server-D

They all connect. Now I’m simulating to send a notification from Server-A to Server-B. It works.
Next what I want to do is disconnect Server B using following:

docker network disconnect bridgename001 Server-B

This works, Server-B is disconnected. Now a message from Server-A to Server-B should:
1} Fail
2} Or if not, atleast somewhere, something should try to do a DNS query on Server-B to try to get IP for it?
3} What I am trying to do is:

4} Create a Mock DNS which has a delay of 10 seconds for every query that comes in
4b} Have docker use my Mock DNS to send all queries to for resolving IP
4c} How do i do this? where do I put my DNS server, which files need to change, what it needs to change to?
4d} We can assume my Mock DNS is listening on 127.0.0.11 on port 53. Currently it’s on Linux machine but I understand that I need to copy this into each container(s). But not sure where, how?

Any help would be appreciated!