How do you create a macvlan network with explicit DNS servers? #19169
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
network
Networking related issue or feature
Issue Description
In pre-netavark podman releases, it was possible to specify
--dns=9.9.9.10
when creating a container. In 4.5.0, I can still create the container with the--dns
argument, but that has no effect:/etc/resolv.conf
is created from the host regardless.Steps to reproduce the issue
Steps to reproduce the issue
podman network create media-test -d macvlan -o parent=v55toys --ipam-driver=host-local --subnet "10.0.5.0/24" --ip-range 10.0.5.225/28 --gateway "10.0.5.1" --dns 9.9.9.10
fails: "Error: cannot set NetworkDNSServers if DNS is not enabled for the network: invalid argument"podman network create media-test -d macvlan -o parent=v55toys --ipam-driver=host-local --subnet "10.0.5.0/24" --ip-range 10.0.5.225/28 --gateway "10.0.5.1"
without DNS servers succeeds, but then:podman run --network=media-test --dns=9.9.9.9 --rm ubuntu:latest cat /etc/resolv.conf
shows the host's DNS configuration. However:podman run --dns=9.9.9.9 --rm ubuntu:latest cat /etc/resolv.conf | grep 9.9.9.9
does work.Describe the results you received
(see repro)
Describe the results you expected
I would have hoped to be able to set DNS servers for all drivers, regardless of whether they have DNS resolution enabled or not.
Even if you can't set the DNS servers on the network, I would have expected the container creation argument to have the desired effect of using the specified servers instead of the host's.
podman info output
Podman in a container
No
Privileged Or Rootless
Privileged
Upstream Latest Release
Yes
Additional environment details
This is running on a physical machine running NixOS 23.05, with a macvlan I'm hoping to parent to a specific ethernet device.
Additional information
No response
The text was updated successfully, but these errors were encountered: