docker-compose use other container as DNS

Viewed 1039

I have a docker-compose file like:

services:
  dns-server:
    # ...
  other:
    image: ubuntu
    dns: dns-server

Is there any way to make the other container use dns-server as its DNS server without hardcoding the IP of that container? Using the container name doesn't give me an error but it doesn't seem to work.

0 Answers
Related