Is it possible to add DNS name resolution for containers?
It would be great to have DNS name resolution for containers based on their names. For example, if I have a container named hoge, I'd like to be able to resolve its internal IP using something like hoge.container or a similar format.
This feature would significantly help with automation and reduce configuration overhead, as we could reference containers by their DNS names rather than hardcoding IP addresses.
I feel like this is addressed in tutorial https://github.com/apple/container/blob/main/docs/tutorial.md#set-up-a-local-dns-domain-optional so yes you can, unless I did not understand the question, and the use case is a bit more complicated than expressed in the question.
Ah, my bad - I didn't properly go through the tutorial. Turns out this feature already does what I need. Thanks! Feel free to close the issue.
Thanks for trying container out!
I had question related with dns thing. Consider this command:
sudo container system dns create test
container system dns default set test
sudo container system dns create cache.test
# resolvable via redis.test, the --dns-domain is not respected
# expected: redis.cache.test
container create --name redis --dns-domain cache.test --dns-option use-vs redis
# resolvable via redis.cache.test, the default domain is not respected
container create --name redis.cache.test redis
Is it expected by design?