DNS lookup not working in WLS2 SUSE subsystem

Adam Zhu 1 Reputation point
2021-05-02T04:33:05.847+00:00

Hi,

I met a DNS problem in my SUSE WSL2 subsystem. I configure my windows DNS servers in /etc/resolv.conf but it does not help to resolve any DNS name. The DNS servers can be pinged successfully in WSL terminal by ICMP. Could you help me on this issue? The logs are as below, the DNS servers are 193.181.14.10, 193.181.14.11 as I have verified them by nslookup in windows. It seems resolve.conf just not working in linux.


From windows powershell:
PS C:\wsl_app> Get-DnsClientServerAddress

InterfaceAlias Interface Address ServerAddresses
Index Family


Ethernet 4 26 IPv4 {193.181.14.10, 193.181.14.11}
Ethernet 4 26 IPv6 {}
Ethernet 17 IPv4 {193.181.14.10, 193.181.14.11, 193.181.14.12}
Ethernet 17 IPv6 {}
vEthernet (NatSwitch) 11 IPv4 {}
vEthernet (NatSwitch) 11 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3}
Local Area Connection* 1 14 IPv4 {}
Local Area Connection* 1 14 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3}
Local Area Connection* 14 28 IPv4 {}
Local Area Connection* 14 28 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3}
Wi-Fi 6 IPv4 {192.168.10.8, 192.168.11.8}
Wi-Fi 6 IPv6 {}
Bluetooth Network Connection 23 IPv4 {}
Bluetooth Network Connection 23 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3}
Loopback Pseudo-Interface 1 1 IPv4 {}
Loopback Pseudo-Interface 1 1 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3}
vEthernet (Default Switch) 30 IPv4 {}
vEthernet (Default Switch) 30 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3}
vEthernet (WSL) 94 IPv4 {}
vEthernet (WSL) 94 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3}

PS C:\wsl_app> nslookup.exe
Default Server: dns-anycast1.<mydomain.com>
Address: 193.181.14.10

istio.io

Server: dns-anycast1.<mydomain.com>
Address: 193.181.14.10

Non-authoritative answer:
Name: istio.io
Address: 75.2.60.5


From WSL2 terminal
<name>@<labtop>:/mnt/c/WINDOWS/system32> sudo vi /etc/resolv.conf
[sudo] password for root:
<name>@<labtop>:/mnt/c/WINDOWS/system32> sudo cat /etc/w
wgetrc wicked/ wsl.conf
<name>@<labtop>:/mnt/c/WINDOWS/system32> sudo cat /etc/wsl.conf
[network]
generateResolvConf = false
<name>@<labtop>:/mnt/c/WINDOWS/system32> sudo cat /etc/resolv.conf

This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:

[network]

generateResolvConf = false

nameserver 193.181.14.10
<name>@<labtop>:/mnt/c/WINDOWS/system32> nslookup

istio.io

;; connection timed out; no servers could be reached
>

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,704 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.