-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rootful containers when using corporate VPN on systemd-resolved systems have broken DNS #17075
Comments
Reproducer, using Red Hat corporate VPN on my laptop
That is, if I run podman under sudo, I cannot reach server on corporate VPN. But if I run it as rootless podman, then some trickery with aardvark-dns and the 10.0.2.3 dns server allows it to work. |
You can enable dns on your network (or create a network with podman network create) which will make it use aardvark-dns (assuming netavark network backend), this will act as proxy and is able to reach 127.0.0.1. |
@Luap99 Thanks, that works!
Is there any truth in #3277 (comment), suggesting that in Podman 4.4 this is intended to work without custom network? If yes, then I think this issue can track that (unless there is another issue for it). Otherwise, I'm happy with creating a named net for my rootful containers and consider this solved. |
Without having dns enabled it will not work, we need some form of proxy to reach localhost on the host. I would say this is the expected behaviour right now. The other way is to use |
edit: yeah, I can't use Another thing that works is I can list the DNS servers explicitly, but beware, on my system the order matters, if I list VPN dns servers first, all works, but if I list my home network DNS first, then resolving on that fails the resolution without moving to VPN dns servers...
|
A friendly reminder that this issue had no activity for 30 days. |
@mheon Is there any truth in your #3277 (comment), suggesting that in Podman 4.4 this is intended to work without custom network? If yes, then I think this issue can track that (unless there is another issue for it). Otherwise, I'm happy with creating a named net for my rootful containers and consider this solved. |
It requires a custom network - 4.4 was required to allow this to work at all. |
@mheon I have |
Can we close this issue now? |
I'd like to understand the podman 4.4 comment better, and whether there are additional improvements planned (for my original problem: without defining custom podman network, rootful containers "don't work", while rootless containers "work"). But over all, my problem has a solution (define custom network when using rootful podman), so I would not mind calling it quits here. |
Yes you need a custom network with dns enabled, there is no other way at the moment. |
As a result podman seems to remove the nameserver line and adds the "upstream" DNS servers directly.
That is, it adds content of /run/systemd/resolve/resolv.conf, which may look like this
Bypassing systemd-resolved on the host may work in some scenarios, but it breaks others.
Consider a corporate VPN connections where "upstream" is not defined. (We have at least two "upstreams" when connected)
Bypassing the host's systemd-resolved has at least the following problems:
So whatever which DNS server I choose by setting
--dns=<ip>
, I will never get the same results as talking to the systemd-resolved running on the host.How to fix that?
Well, I guess it's not possible at all.
podman
would have to replacenameserver 127.0.0.53
with something that is forwarded or hosted on the host. But systemd-resolved is listening on the loopback interface only and does not allow (AFAIK) to change / configure that.The combination of systemd-resolved and podman is the default for Fedora users.
So privileged containers are quite unusable when corporate VPNs are in the game.
Originally posted by @fbezdeka in #3277 (comment)
The text was updated successfully, but these errors were encountered: