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

WSL 2 apparently not resolving hostnames via DNS - IP addresses work #8322

Closed
1 of 2 tasks
mkkekkonen opened this issue Apr 23, 2022 · 2 comments
Closed
1 of 2 tasks

Comments

@mkkekkonen
Copy link

mkkekkonen commented Apr 23, 2022

Version

Microsoft Windows [Version 10.0.19043.1645]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.102.1

Distro Version

Ubuntu 22.04

Other Software

ping from iputils 20211215
OpenSSH_8.9p1 Ubuntu-3, OpenSSL 3.0.2 15 Mar 2022
apt 2.4.5 (amd64)

Repro Steps

Run either

ping google.com

to check connectivity, or

ssh server.com

to SSH into a server (server.com is a dummy address), or

sudo apt-get update

to refresh the package repositories.

Also, add /etc/wsl.conf with the following content:

[network]
generateResolvConf = false

...remove the default /etc/resolv.conf, and add a new one with the following content:

nameserver 8.8.8.8  # Google DNS
nameserver 8.8.4.4

Set default DNS addresses in Windows to 8.8.8.8 and 8.8.4.4.

Expected Behavior

The commands should work with hostnames, not just IP addresses.

Actual Behavior

ping

Nothing gets printed out when running ping google.com, the terminal just freezes/hangs and nothing happens. I can't even terminate the process with Ctrl+C.

ping with an IP address, e.g. ping 8.8.8.8 works.

ssh

ssh server.com: Same result as with ping, terminal freezes, can't terminate the command.

ssh 123.45.67.89 works.

apt

The output stays at 0 % like so:

0% [Connecting to security.ubuntu.com]

WSL2 used to connect to Internet just fine but today I happened to notice this issue. Also, the vEthernet (WSL) network adapter is missing in Windows. I do not know if it relates to this issue or how to get it back.

SSH, ping and browsing works fine on Windows.

Diagnostic Logs

No response

@ghost ghost self-assigned this May 3, 2022
@OneBlue
Copy link
Collaborator

OneBlue commented May 3, 2022

/dupe #8365

@ghost
Copy link

ghost commented May 3, 2022

Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread.

Thanks for your report!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants