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


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:

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 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!