Closed aleksanderdidriksen closed 11 months ago
The 4.4.1 behavior was broken, adding the upstream sever into the containers resolv.conf means they can bypass aardvark-dns and fail to resolve container names. The given upstream dns servers are given to aardvark-dns and it will forward accordingly so this still works correctly. see #https://github.com/containers/podman/issues/17499
Issue Description
In Podman 4.6.1 and Podman 4.7.0 it will not pass the DNS resolvers options specified on the network to the container when the DNS plugin is enabled using bridge network. However, it will still correctly populate /etc/resolv.conf with container to container name resolution.
In Podman 4.4.1 the file /etc/resolv.conf is correctly populated inside of the container with DNS resolvers specified using --dns when the DNS plugin is enabled.
According to latest docs podman-network-create, options: --dns=ip Set network-scoped DNS resolver/nameserver for containers in this network. If not set, the host servers from /etc/resolv.conf is used. It can be overwritten on the container level with the podman run/create --dns option. This option can be specified multiple times to set more than one IP.
Steps to reproduce the issue
Describe the results you received
When /etc/resolv.conf is: search my.domain nameserver 8.8.8.8
Running: podman network create, stdout: podman1 podman run -it --rm --network podman1 container-registry.oracle.com/os/oraclelinux:9 cat /etc/resolv.conf
search dns.podman nameserver 10.89.0.1
Running: podman network create --dns 8.8.8.8, stdout: podman2 podman run -it --rm --network podman2 --dns 8.8.8.8 container-registry.oracle.com/os/oraclelinux:9 cat /etc/resolv.conf
search dns.podman nameserver 10.89.1.1
Running: podman network create --disable-dns, stdout: podman3 podman run -it --rm --network podman3 container-registry.oracle.com/os/oraclelinux:9 cat /etc/resolv.conf
search my.domain nameserver 8.8.8.8
Running: podman run -it --rm --network default container-registry.oracle.com/os/oraclelinux:9 cat /etc/resolv.conf
search my.domain nameserver 8.8.8.8
Describe the results you expected
When /etc/resolv.conf is: search my.domain nameserver 8.8.8.8
When DNS plugin is enabled and no --dns option is provided, /etc/resolv.conf inside of the container should be like in Podman 4.4.1: search dns.podman my.domain nameserver 10.89.0.1 8.8.8.8
When DNS plugin is enabled and --dns 8.8.8.8 option is provided when creating the network (network_dns_servers: 8.8.8.8), /etc/resolv.conf inside of the container should be: search dns.podman nameserver 10.89.0.1 8.8.8.8
podman info output
Podman in a container
No
Privileged Or Rootless
Privileged
Upstream Latest Release
No
Additional environment details
Fedora CoreOS Stable v 39.20231101.3.0 Driver: bridge
Additional information
No response