Skip to content
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

podman remote bypass system resolver and fails to resolve mDNS hostnames. #10737

Closed
Jean-Daniel opened this issue Jun 21, 2021 · 10 comments · Fixed by #11976 or #12327
Closed

podman remote bypass system resolver and fails to resolve mDNS hostnames. #10737

Jean-Daniel opened this issue Jun 21, 2021 · 10 comments · Fixed by #11976 or #12327
Assignees
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. Packaging Bug is in a Podman package remote Problem is in podman-remote

Comments

@Jean-Daniel
Copy link

Jean-Daniel commented Jun 21, 2021

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

When trying to connect to a ".local" hostname with Podman remote, it tries to resolve the hostname by querying the network DNS instead of using the local resolver and fails to resolve the hostname.

I have a running machine that advertise the podman.local hostname using a mDNS daemon. This host is perfectly reachable from my macOS machine using ssh, ping and any other tool. But when trying to connect it using podman, it fails with

error `Error: failed to create sshClient: Connection to bastion host (ssh://[email protected]:22/run/podman/podman.sock) failed.: dial tcp: lookup podman.local on 10.2.0.1:53: no such host`

10.2.0.1 is the local network DNS server (as declared in the generated /etc/resolv.conf) but by bypassing the local resolver/cache, podman fails to properly resolve the remote hostname.

Steps to reproduce the issue:

  1. Start a VM with avahi (to advertise the .local hostname), and podman.

  2. On a host that can reach this VM via ssh, configure a podman remote connection using '.local' as server name.

  3. Try to connect to it (podman info)

Describe the results you received:

Podman try to use its own DNS resolver machinery and fails to resolve the hostname.

Describe the results you expected:

Podman properly use the system resolver and connect to the remote host.

Output of podman version:

podman version 3.2.1

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)

Yes

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 21, 2021
@jwhonce
Copy link
Member

jwhonce commented Jun 21, 2021

@Jean-Daniel We will have to dig into the cause here. Podman currently delegates this lookup to the Go ssh library. See https://github.com/containers/podman/blob/master/pkg/bindings/connection.go#L263

/cc @baude

@mheon mheon added the remote Problem is in podman-remote label Jun 21, 2021
@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Jul 22, 2021

@jwhonce Any thing new on this one?

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Sep 23, 2021

@Jean-Daniel Are you still seeing this issue?

@rhatdan
Copy link
Member

rhatdan commented Sep 23, 2021

If you ssh into the VM and using podman there, do you see the same problem?

@jwhonce
Copy link
Member

jwhonce commented Oct 13, 2021

@rhatdan I have reproduce the issue on Big Sur and it appears to be related to golang/go#12524 . I want to talk to @ashley-cui about packaging to see if we can tweak the Makefile to use cgo when building via homebrew.

@jwhonce jwhonce added the Packaging Bug is in a Podman package label Oct 13, 2021
@ashley-cui
Copy link
Member

@jwhonce to use cgo in homebrew, it should be as simple as adding ENV["CGO_ENABLED"] = "1" to the homebrew formula. I'm not too too familiar with out makefile, would we have to make changes there too?

@jwhonce
Copy link
Member

jwhonce commented Oct 14, 2021

@ashley-cui Yeah, I'll make a PR with the needed changes to the Makefile. BTW, I used brew reinstall -s podman to rebuild podman on my mac.

jwhonce added a commit to jwhonce/podman that referenced this issue Oct 14, 2021
Need to use CGO for mDNS resolution, but cross builds need CGO disabled
See golang/go#12524 for details

Note: Homebrew forumla will need to be updated to pick up this change

Fixes containers#10737

Signed-off-by: Jhon Honce <[email protected]>
zeha pushed a commit to zeha/podman that referenced this issue Nov 17, 2021
Need to use CGO for mDNS resolution, but cross builds need CGO disabled
See golang/go#12524 for details

Note: Homebrew forumla will need to be updated to pick up this change

Fixes containers#10737

Signed-off-by: Jhon Honce <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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. Packaging Bug is in a Podman package remote Problem is in podman-remote
Projects
None yet
5 participants