-
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
DNS resolution works only for one network when two networks are attached #8399
Comments
@baude PTAL |
Question @mheon @baude, If I specify several networks shouldn't I have several interfaces in the container? Because right now (tested with master) I only have one (the latest). This happens both as rootless and rootful. That would also explain the dns issue since you can only resolve dns entries in your own network, right? |
|
OK, so there two issues here. Second the dns is still not working for both names besides joining both networks.
So both dns servers are working but the container will only contact the first one. @baude @mheon Ideas? |
@Luap99 Thanks for the hint regarding the syntax, that makes sense and I'll use that instead. Good to see that with the correct syntax the entries in So then I am not sure if being able to resolve names in both networks is even a valid expectation in the first place. |
This may be a design limitation based on the architecture of the current dnsname plugin, but we need @baude to comment to be certain. |
Did not mean to close, sorry |
does this fail for rootless and rootful? |
as for design, I dont think this is a limitation but i would need to poke at this further. It seems reasonable that this should work. @Luap99 i see you have put this in progress which indicates you are working on it. ping me if you have any questions ... im happy to help. |
@baude It fails for rootless and rootful. The problem is that dnsname plugin creates a dnsserver per network and a single container will always use the first sever in I don't think I can do anything here. |
A friendly reminder that this issue had no activity for 30 days. |
@baude Any other input? I think this should at least be documented when that is the expected behaviour. |
I am too running into this issue where I want to have a setup with a reverse proxy and multiple containers behind it with each it's own network to the reverse proxy container for network segregation. I assume this is not expected if there is no workaround. Docker, for example, does seem to handle this setup. And not being able to segregate my network is a bit of a show stopper. (for security reasons) |
I'm hitting this issue as well, and I agree it's a show-stopper when attempting to segregate the network across various domains. Apparently, there's been some discussion about this over at containers/dnsname#12, and reasonable resolution (running dnsmasq as part of each container) doesn't seem like a quick fix... |
A friendly reminder that this issue had no activity for 30 days. |
@simonkrenger @Luap99 @deuill Is this fixed now in the dnsname patch that is merged? |
@rhatdan No. This is going to require major changes - it's what we were discussing last week. |
Ok got it. |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
Is there any update for this? I would love to properly separate networks but have predictable DNS resolution in containers with multiple networks. |
We are getting towards completion of rewrite of network stack, so issues like this will be reviewed when the stack is ready. |
this will work in aardvark with podman 4.0. |
in podman 4 now |
Just to confirm: DNS resolution for containers with multiple networks attached is expected to work as of Podman 4.x only for |
@deuill Yes it will not work for cni. If you changed the config setting and reboot it will work except for all your cni configs. We do not migrate the cni config files so you would have to recreate your network with podman network create after you changed the network backend. |
I'm working on a blogpost for the new Netavark feature - I can cover how to upgrade in that. Should be out concurrent with the final release. |
Is this a BUG REPORT or FEATURE REQUEST?
/kind bug
Description
PR #7460 introduced support for
podman network create
with the ability to create networks and interact between containers using DNS entries. The following works as expected for bothweb-a.dns.podman
and also justweb-a
:However, when there are two networks attached to the client container (for example a reverse proxy), DNS is only resolved for the last
--network
specified in thepodman run
command.Accessing the containers via IPs works as expected, so networking is not an issue, only the DNS resolution.
Steps to reproduce the issue:
Create two networks and launch a
nginx
container into both networks:Use a third client container to access the other two containers
Describe the results you received:
The container fails to resolve any DNS entries for containers in the first network specified:
Describe the results you expected:
DNS resolution is expected to work for both networks as follows
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
Tested on VirtualBox with
centos-release-8.2-2.2004.0.2.el8.x86_64
The text was updated successfully, but these errors were encountered: