Podman: Use 127.0.0.1 for host.containers.internal in Host Network Mode

Scritto da Alessio il 02/02/2026

Problem

When running containers with host network mode, host.containers.internal wasn't resolvable. The host network mode doesn't create the bridge interface that host.containers.internal requires.

Solution

Detected host network mode and used 127.0.0.1 instead of host.containers.internal for container-to-host access. This is the correct address when running in host network mode.

Result

Containers can reach the host correctly regardless of network mode. Consistent networking behavior across configurations.

Commit: containers/podman@fae93fe