Container can't resolve hostname (but Host OS works fine)


We have a customer with a setup in which a container can’t resolve an ip address. The device is on a guest network that might have some restrictions but Balena can successfully access the cloud and the Host shell can successfully resolve the DNS.

For example:
is successful in Host OS shell

but it fails in any of the containers:
curl: (6) Could not resolve host:

Note that the same app/image works fine in other locations.

Any idea why this fails?



So it looks like the customer’s network is:
inet addr: Bcast: Mask:

Whereas balena is using, inside the container, the following subnet:
inet netmask broadcast

So, basically, the balena subnet is overlapping with the customer subnet.

Is there a way to change it? why is balena using a subnet network?


Ok - figured it out.

For anyone bumping into this in the future, the solution was to configure the default bridging network used for the containers.

Adding the following lines to the docker-compose.yml solved the problem:
driver: default
- subnet: “”
- subnet: “2001:3984:3989::/64”