containers / dnsname

name resolution for containers
Apache License 2.0
177 stars 48 forks source link

podman --subuidname does not set resolv.conf #9

Open ibotty opened 5 years ago

ibotty commented 5 years ago

I am running the latest podman from the projectatomic ppa repository

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.

mheon commented 5 years ago

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

ibotty commented 5 years ago

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

mheon commented 5 years ago

Ah, a container in a user namespace. Hm.

ibotty commented 5 years ago

Right, but in the host's net namespace.

rhatdan commented 5 years ago

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
ibotty commented 5 years ago

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).

baude commented 5 years ago

i dont follow what should happen. can anyone elaborate ?

ibotty commented 5 years ago

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.

baude commented 5 years ago

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

rhatdan commented 5 years ago

Sounds like an error to me.