DNS resolution works only on custom bridge networks, but not on the default. Docker Compose creates a custom network by default calling it “default” in the compose yaml, but it is not required to define and it would be projectname_default in the list of docker networks and not “bridge”.