Cannot resolve a host from a local hosts entry #8058
Labels
area/networking
kind/bug
Something isn't working
platform/windows
regression
Functionality was working in a previous release and is now broken
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
The text was updated successfully, but these errors were encountered: