1

My server has got a publicly accessible hostname, which obviously points to the public ip address of the network. This works great to access the server from elsewhere.

When using this hostname/public ip address internally... nothing will happen, because of the way the router is set up, unfortunately. Accessing the public ip address from within the network doesn't work.

So I've configured Adguard on this server to return its own local ip address when the public hostname is requested. Works great!

But Docker doesn't like this.

By default, the docker daemon makes the containers use 8.8.8.8 as a DNS server. When I change it to 172.17.0.1 it doesn't really work, because the docker containers don't know what to do with the server's "local" ip address.

So I tried setting up a second dns server with another override, pointing the public hostname to 172.17.0.1, but I can't actually use that in the daemon options: setting a different port for the dns server (like 127.17.0.1:530) is not supported.

So then I tried to dockerize the second dns server itself. Make it expose port 53. But I can't give it a static ip on the same network as the other containers (--ip 172.17.0.222:53/udp is just ignored, and it uses a random ip instead)

So then I created a new network. Now --ip 172.18.0.2:53/udp does work. But the other containers can't access that because the networks are isolated!

Does anyone else have any other ideas? :/

Jelle De Loecker
  • 1,094
  • 6
  • 17
  • 30

0 Answers0