How do I configure podman to allow containers to reach each other by name? #26104
-
I've been working with podman for almost 5 years now, but there's one thing I've never managed to do: allow two containers, connected by a network, reach each other by name and/or network-alias. This applies to all network configurations I've tried, including internal networks and ones using both CNI and netavark. Can anyone give me a dead simple example of connecting two containers by name on an explicitly defined network while one container also uses a non-internal network? Ideally this would be defined in Quadlets and use netavark-based networking, but at this point just having something that works to go off of would be appreciated. I'm running podman v5.2.2 at the moment. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
This should just work as long as you are using bridge networks and make sure the networks shows |
Beta Was this translation helpful? Give feedback.
-
@Luap99, thank you so much. That has been bugging me for years. |
Beta Was this translation helpful? Give feedback.
-
Your example worked for rootless containers, so thank you! Any idea how to get it working with rootful ones? It still failed when I tried to use rootful networking. |
Beta Was this translation helpful? Give feedback.
This should just work as long as you are using bridge networks and make sure the networks shows
"dns_enabled": true,
when you inspect it so it uses aardvark-dns to resolve the container names