Solved WSL for Linux with DNS resolve


incedis

Member
Local time
2:41 AM
Posts
51
OS
win11 pro 21H2 22000.613
My little Bro wants to play with Linux. I installed WSL but I do not have a DNS resolution. When I try to ping google for ex, it simply won't work.
He is on a local account. I checked on my account with admin rights and could not get DNS resolution either.
I tried in the firewall to untick the protected network for wsl but to no avail. Plus after reboot it comes back as protected.
I wanted to check the logs in windows firewall but was not allowed to open the file. My account is the admin. I guess 2 problems in one. Firewall log file is not encrypted and my account has full priviliges. Any help is much appreciated for my little Bro to learn Linux :)
 

My Computer

System One

  • OS
    win11 pro 21H2 22000.613
    Computer type
    Laptop
    Manufacturer/Model
    MSI Delta 15
    CPU
    AMD Ryzen 9 5900HX
    Motherboard
    Micro-Star International Co., Ltd. MS-15CK
    Memory
    64

pparks1

Well-known member
Member
VIP
Local time
10:41 PM
Posts
320
OS
Windows 11 Pro
Can you ping something by it's IP address?
For example, ping 8.8.8.8

On the Linux WSL host, cat /etc/resolv.conf and let me know if you see something like this
1653585928135.png
On the windows side, if you run ipconfig, you should see this same IP.

1653585974077.png
 

My Computer

System One

  • OS
    Windows 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    Beelink SEI8
    CPU
    Intel Core i5-8279u
    Motherboard
    AZW SEI
    Memory
    32GB DDR4 2666Mhz
    Graphics Card(s)
    Intel Iris Plus 655
    Sound Card
    Intel SST
    Monitor(s) Displays
    Asus ProArt PA278QV
    Screen Resolution
    2560x1440
    Hard Drives
    512GB NVMe
    PSU
    NA
    Case
    NA
    Cooling
    NA
    Keyboard
    NA
    Mouse
    NA
    Internet Speed
    500/50
    Browser
    Edge
    Antivirus
    Defender
    Other Info
    Mini PC used for testing Windows 11.

incedis

Member
Thread Starter
Local time
2:41 AM
Posts
51
OS
win11 pro 21H2 22000.613
Yes I can ping google DNS.. 8.8.8.8


# generateResolvConf = false
nameserver 172.18.16.1

Ethernet adapter vEthernet (WSL):

Connection-specific DNS Suffix . :
IPv4 Address. . . . . . . . . . . : 172.18.16.1
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . :
 

My Computer

System One

  • OS
    win11 pro 21H2 22000.613
    Computer type
    Laptop
    Manufacturer/Model
    MSI Delta 15
    CPU
    AMD Ryzen 9 5900HX
    Motherboard
    Micro-Star International Co., Ltd. MS-15CK
    Memory
    64

incedis

Member
Thread Starter
Local time
2:41 AM
Posts
51
OS
win11 pro 21H2 22000.613
My little Bro telling me when he is trying to update for ex Ubuntu "sudo apt update" its not working.
Err:2 Index of /ubuntu focal-security InRelease
Temporary failure resolving 'security.ubuntu.com'

When I try DNS lookup for google.com
#dig google.com
I get " connection timed out; no servers could be reached"

I thought the issue with updating could be linked to a DNS issue ?

Having said that the ping working, I am not sure now.
 

My Computer

System One

  • OS
    win11 pro 21H2 22000.613
    Computer type
    Laptop
    Manufacturer/Model
    MSI Delta 15
    CPU
    AMD Ryzen 9 5900HX
    Motherboard
    Micro-Star International Co., Ltd. MS-15CK
    Memory
    64

incedis

Member
Thread Starter
Local time
2:41 AM
Posts
51
OS
win11 pro 21H2 22000.613
Ok solve the issue..
Added nameserver 8.8.8.8 and now the connection is going through. Thanks for your help that gave me the idea
 

My Computer

System One

  • OS
    win11 pro 21H2 22000.613
    Computer type
    Laptop
    Manufacturer/Model
    MSI Delta 15
    CPU
    AMD Ryzen 9 5900HX
    Motherboard
    Micro-Star International Co., Ltd. MS-15CK
    Memory
    64

jimbo45

Well-known member
Power User
VIP
Local time
2:41 AM
Posts
1,639
Location
Hafnarfjörður IS
OS
Windows XP,7,10,11 Linux Arch Linux
Ok solve the issue..
Added nameserver 8.8.8.8 and now the connection is going through. Thanks for your help that gave me the idea
A better idea (IMO only though) is to create a VM ( Virtual Machine) for him - so if it breaks won't hose up your main machine and you / he can run the entire thing from an external device. Plenty of Live distros out there - UBUNTU and Mint are probably the easiest to start with.

WSL works fine but I wouldn't suggest it's the place for Linux Newbies to start with, and it requires some resources on the Windows machine too.

VMWare / VBOX have good VM programs that can run easily on a Windows Host. Free also for domestic / non commercial users.

Cheers
jimbo
 

My Computer

System One

  • OS
    Windows XP,7,10,11 Linux Arch Linux
    Computer type
    PC/Desktop
    CPU
    2 X Intel i7

incedis

Member
Thread Starter
Local time
2:41 AM
Posts
51
OS
win11 pro 21H2 22000.613
THought about it but he is on a local account which limits a lot. It limits a lot because he is 12 but he is already hacking. Also he is a lot smarter than I am regarding IT. Local Accounts would mean, me having to do a lot of work for him in order for my little Bro to expand. In short, I put limits but he has no limits. He is into IT, I am not :)..
I think I am about to give him my laptop entirely and probably move to MAC. WIn 11 has been very much a nightmare since day one and I get tired spending too much time looking for workaround/solutions to have my laptop simple works.
 

My Computer

System One

  • OS
    win11 pro 21H2 22000.613
    Computer type
    Laptop
    Manufacturer/Model
    MSI Delta 15
    CPU
    AMD Ryzen 9 5900HX
    Motherboard
    Micro-Star International Co., Ltd. MS-15CK
    Memory
    64
Top Bottom