dnsname icon indicating copy to clipboard operation
dnsname copied to clipboard

podman --subuidname does not set resolv.conf

Open ibotty opened this issue 6 years ago • 10 comments

I am running the latest podman from the projectatomic ppa repository

  • podman 1.6.1-1~ubuntu18.04~ppa3,
  • containernetworking-plugins 0.8.2-1~ubuntu18.04~ppa3 and
  • dnsname f5af33d.

When running a podman container with --subuidname, it does not correctly modify resolv.conf but uses the host's resolv.conf instead:

$ # correct:
$ sudo podman run alpine cat /etc/resolv.conf
search my-hosts.search
nameserver 10.88.0.1
$ # incorrect
$ sudo podman run --subuidname alpine cat /etc/resolv.conf
search my-hosts.search
nameserver my-hosts-nameserver1
nameserver my-hosts-nameserver1

I don't know whether that's a ticket for podman or dnsname. Please delegate if I am wrong.

ibotty avatar Oct 11 '19 15:10 ibotty

I'm not familiar with any Podman flag named setuidname - is this a separate program being used to run Podman?

mheon avatar Oct 11 '19 16:10 mheon

Argh. I forgot to copy paste correctly! I meant --subuidname. Sorry for the mistake.

ibotty avatar Oct 11 '19 16:10 ibotty

Ah, a container in a user namespace. Hm.

mheon avatar Oct 11 '19 16:10 mheon

Right, but in the host's net namespace.

ibotty avatar Oct 11 '19 16:10 ibotty

I see no difference?

sh-5.0# sudo podman run --subuidname dwalsh alpine cat /etc/resolv.conf
search redhat.com
nameserver 10.11.5.19
nameserver 10.5.30.160
nameserver 192.168.1.1
sh-5.0# sudo podman run alpine cat /etc/resolv.conf
search redhat.com
nameserver 10.11.5.19
nameserver 10.5.30.160
nameserver 192.168.1.1

rhatdan avatar Oct 11 '19 16:10 rhatdan

Are you using the dnsname plugin? Because AFAICT the dnsname plugin sets the nameserver to the bridge's gateway address (because that's where it instructs dnsmasq to listen).

ibotty avatar Oct 11 '19 16:10 ibotty

i dont follow what should happen. can anyone elaborate ?

baude avatar Oct 11 '19 17:10 baude

Dnsname configures a dnsmasq server to listen on the bridge gateway address (on the host). It correctly configures resolv.conf to point to that nameserver when used without using user namespaces. When using user namespaces it does not.

ibotty avatar Oct 11 '19 17:10 ibotty

@ibotty interesting, thanks for the clarification. Do we all feel that is in error?

baude avatar Oct 11 '19 17:10 baude

Sounds like an error to me.

rhatdan avatar Oct 11 '19 18:10 rhatdan