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

Cannot resolve a host from a local hosts entry #8058

Closed
akhilesh-d opened this issue Jan 9, 2025 · 8 comments
Closed

Cannot resolve a host from a local hosts entry #8058

akhilesh-d opened this issue Jan 9, 2025 · 8 comments
Assignees
Labels
area/networking kind/bug Something isn't working platform/windows regression Functionality was working in a previous release and is now broken
Milestone

Comments

@akhilesh-d
Copy link

Actual Behavior

An entry in the (Windows 11) local hosts file cannot be resolved inside a running container from linux shell running inside the container.

Steps to Reproduce

Start RancherDesktop with dockerd as the container runtime.
Make an entry in your local c:\Windows\system32\drivers\etc\hosts like

172.26.80.1 rd-local

start a basic alpine:
docker run -it --rm alpine sh

In the started container shell call
ping rd-local

Result

The ping fails with the message
ping: bad address 'rd-local'

Result

C:>docker run -it --rm alpine sh

/ # ping rd-local
ping: bad address 'rd-local'
/ # ping www.google.com
PING www.google.com (142.250.194.4): 56 data bytes
64 bytes from 142.250.194.4: seq=0 ttl=63 time=0.404 ms
64 bytes from 142.250.194.4: seq=1 ttl=63 time=1.268 ms
^C
--- www.google.com ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.404/0.836/1.268 ms
/ #

Expected Behavior

The ping should succeed.

Additional Information

It was working ok in 1.16 , issue started coming after upgrade to 1.17

Environment details

Container Engine :dockerd ( moby)
OS: Windows 11 Version 23H2
WSL version: 2.4.8.0 (latest pre-release)
Kernel version: 5.15.167.4-1

.wslconfig

[experimental]
bestEffortDnsParsing=true

I have added following line in c:\Windows\System32\drivers\etc\hosts

172.26.80.1 rd-local

Rancher Desktop Version

1.17

Rancher Desktop K8s Version

1.30.7

Which container engine are you using?

moby (docker cli)

What operating system are you using?

Windows

Operating System / Build Version

Windows 11, 23H2

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

None

Windows User Only

Yes, VPN : GlobalProtect App Version 6.2.5

@akhilesh-d akhilesh-d added the kind/bug Something isn't working label Jan 9, 2025
@Nino-K Nino-K self-assigned this Jan 9, 2025
@jandubois jandubois added platform/windows area/networking regression Functionality was working in a previous release and is now broken labels Jan 9, 2025
@jandubois
Copy link
Member

@Nino-K I added the regression label because @akhilesh-d reported in #1245 (comment) that this worked correctly in 1.16.0.

@fiburonsk
Copy link

i see the same behavior using containerd instead of moby after upgrading to 1.17 when I try to resolve a name from my c:\Windows\system32\drivers\etc\hosts file.

additionally i run a coredns dns service in windows for more control on name resolution which works in 1.16 and is no longer resolving names in 1.17 from inside a container.

@jandubois jandubois added this to the 1.17.1 milestone Jan 13, 2025
@Nino-K
Copy link
Member

Nino-K commented Jan 15, 2025

@akhilesh-d thanks for reporting this, can you give 1.16.0 a try to see if you are encountering the same thing?

@akhilesh-d
Copy link
Author

akhilesh-d commented Jan 15, 2025

@Nino-K I have been running 1.16.0 before and it worked fine, issue came only post-upgrade to 1.17.0

@CODY-RAY
Copy link

Same ^

@evilhamsterman
Copy link

If it was working in 1.16 it's probably another duplicate of #8055.

@michael-crompton
Copy link

I had the same issue with v1.17.0.
Rolling back to v1.16 solved my problem

@Nino-K
Copy link
Member

Nino-K commented Jan 21, 2025

We are planning to release patch version 1.17.1 to address this issue. The root cause was an upgrade of gvisor-tap-vsock to v0.8.1. As part of the fix, we have downgraded it to v0.7.5, which should resolve the problem.

@Nino-K Nino-K closed this as completed Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking kind/bug Something isn't working platform/windows regression Functionality was working in a previous release and is now broken
Projects
None yet
Development

No branches or pull requests

7 participants