3

WLS is not resolving internet addresses

pauloh@stanley:~$ wget www.google.com
--2022-10-22 22:27:19--  http://www.google.com/
Resolving www.google.com (www.google.com)... failed: Temporary failure in name resolution.

The resolve.conf file is being created automatically:

pauloh@stanley:~$ 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 172.26.178.1

The windows ipconfig:

  PS C:\Users\pauloh> ipconfig /all

  ...

  Ethernet Adapter vEthernet (WSL):

     Connection-specific DNS Suffix . :
     Description. . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter
     Physical Address . . . . . . . . : 00-25-5A-7A-7B-65
     DHCP Enabled . . . . . . . . . . : No
     Autoconfiguration Enabled. . . . : Sim
     Link-local IPv6 Address. . . . . : fe80::875c:cda4:b862:9187%107(Preferred)
     IPv4 Address. . . . . . . .  . . : 172.26.178.1(Preferred)
     Subnet Mask. . . . . . . . . . . : 255.255.240.0
     Default Gateway. . . . . . . . . :
     DHCPv6 IAID. . . . . . . . . . . : 1795167581
     DHCPv6 Client DUID . . . . . . . : 00-01-00-01-25-CD-39-BF-C4-9D-ED-24-F8-F4
     NetBIOS over Tcpip . . . . . . . : Enabled

If I edit /etc/ressolve.conf and alter nameserver to 8.8.8.8 or 1.1.1.1 I can reach to sites addresses. I can edit /etc./wsl.conf and add generateResolvConf = false to keep this behaviour. My problem happens when I access VPN that resolv.conf is much more complicated

I would like to undertand what's the relation with wsl's resolve.conf and the host's Ethernet adapter to fix wsl automatically configuration.

3
  • By default, WSL should be using your primary DNS server I believe. What's the server that's shown when launching nslookup on Windows?
    – Daniel B
    Commented Oct 23, 2022 at 9:22
  • @DanielB Default Server: UnKnown Address: 2804:14d:1:0:181:213:132:6 Commented Oct 24, 2022 at 10:17
  • found a partial solution. This command resolves domains from internet but not from intranet when into VPN: New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow Commented Oct 24, 2022 at 13:29

1 Answer 1

0

Microsoft Docs shows in this screenshot (1), that by adding generateResolvConf = false WSL2 uses the stub dns resolver of your host, that is inbuilt with Windows. That's why it then shows the primary ipv4 address of your host system in the /etc/resolv.conf.

To better understand your problem it would be great if you modify the question by extending info about your VPN configuration.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .