Windows Version
Microsoft Windows [Version 10.0.19045.6456]
WSL Version
2.7.13.0
Are you using WSL 1 or WSL 2?
Kernel Version
6.18.33.2-microsoft-standard-WSL2
Distro Version
Ubuntu 26.04 LTS (also reproducible from the system distro, Microsoft Azure Linux 3.0)
Other Software
DHCP server on the LAN is Pi-hole FTL (dnsmasq-pi-hole-v2.92rc1). Any DHCP server that only returns options listed in the client's Parameter Request List (dnsmasq, Kea, ISC dhcpd) is affected.
Repro Steps
.wslconfig:
[wsl2]
networkingMode=bridged
vmSwitch=WSL-Bridge
Use a DHCP server that only sends options the client asks for (Pi-hole / dnsmasq defaults).
Start a distro and look at /etc/resolv.conf (symlink to /mnt/wsl/resolv.conf).
Expected Behavior
/mnt/wsl/resolv.conf contains the nameserver (and domain/search) lines handed out by DHCP, like the Windows host gets on the same bridge.
Actual Behavior
eth0 gets an IP address and default route from DHCP, but resolv.conf has no nameserver at all:
$ cat /etc/resolv.conf
Generated by dhcpcd
/etc/resolv.conf.head can replace this line
/etc/resolv.conf.tail can replace this line
Diagnostic Logs
Root cause
StartDhcpClient() in src/linux/init/main.cpp writes this dhcpcd.conf and runs dhcpcd -w -4 -f /dhcpcd.conf eth0:
option subnet_mask, routers, broadcast, domain_name, domain_name_servers, domain_search, host_name, interface_mtu
noarp
timeout {}
dhcpcd has no option called broadcast; option 28 is broadcast_address. dhcpcd 10.0.8 (the version in the system distro) rejects the entire option line:
unknown option: subnet_mask, routers, broadcast, domain_name, domain_name_servers, domain_search, host_name, interface_mtu
so domain_name_servers, domain_name, domain_search, host_name and interface_mtu are never put in the Parameter Request List. A DHCP server that honours the PRL therefore omits option 6, and dhcpcd's 20-resolv.conf hook writes a resolv.conf with no nameservers.
Proof (run as root in the system distro, wsl --system -u root)
WSL's config, test mode (-T), OFFER has no DNS:
printf 'option subnet_mask, routers, broadcast, domain_name, domain_name_servers, domain_search, host_name, interface_mtu\nnoarp\ntimeout 30\n' > /tmp/w.conf
dhcpcd -T -4 -f /tmp/w.conf eth0
unknown option: subnet_mask, routers, broadcast, domain_name, domain_name_servers, domain_search, host_name, interface_mtu
eth0: offered 192.168.1.40 from 192.168.1.12
new_dhcp_server_identifier=192.168.1.12
new_ip_address=192.168.1.40
new_routers=192.168.1.12
Same config with broadcast -> broadcast_address, OFFER now carries DNS:
sed -i 's/broadcast,/broadcast_address,/' /tmp/w.conf
dhcpcd -T -4 -f /tmp/w.conf eth0
eth0: offered 192.168.1.40 from 192.168.1.12
new_domain_name_servers=192.168.1.12
new_domain_name_servers=192.168.1.12
...
The Windows host on the same vSwitch (ipconfig /all) receives DNS Servers: 192.168.1.12 from the same server, confirming the server is fine and the client request is what differs.
Fix
One-word change in src/linux/init/main.cpp (StartDhcpClient): broadcast -> broadcast_address. Patch attached / PR to follow.
Workarounds
Distro side: [network] generateResolvConf=false in /etc/wsl.conf and configure DNS statically (e.g. via systemd-resolved).
Server side (dnsmasq): dhcp-option-force=option:dns-server, so option 6 is sent even when not requested.
Windows Version
Microsoft Windows [Version 10.0.19045.6456]
WSL Version
2.7.13.0
Are you using WSL 1 or WSL 2?
Kernel Version
6.18.33.2-microsoft-standard-WSL2
Distro Version
Ubuntu 26.04 LTS (also reproducible from the system distro, Microsoft Azure Linux 3.0)
Other Software
DHCP server on the LAN is Pi-hole FTL (dnsmasq-pi-hole-v2.92rc1). Any DHCP server that only returns options listed in the client's Parameter Request List (dnsmasq, Kea, ISC dhcpd) is affected.
Repro Steps
.wslconfig:
[wsl2]
networkingMode=bridged
vmSwitch=WSL-Bridge
Use a DHCP server that only sends options the client asks for (Pi-hole / dnsmasq defaults).
Start a distro and look at /etc/resolv.conf (symlink to /mnt/wsl/resolv.conf).
Expected Behavior
/mnt/wsl/resolv.conf contains the nameserver (and domain/search) lines handed out by DHCP, like the Windows host gets on the same bridge.
Actual Behavior
eth0 gets an IP address and default route from DHCP, but resolv.conf has no nameserver at all:
$ cat /etc/resolv.conf
Generated by dhcpcd
/etc/resolv.conf.head can replace this line
/etc/resolv.conf.tail can replace this line
Diagnostic Logs
Root cause
StartDhcpClient() in src/linux/init/main.cpp writes this dhcpcd.conf and runs dhcpcd -w -4 -f /dhcpcd.conf eth0:
option subnet_mask, routers, broadcast, domain_name, domain_name_servers, domain_search, host_name, interface_mtu
noarp
timeout {}
dhcpcd has no option called broadcast; option 28 is broadcast_address. dhcpcd 10.0.8 (the version in the system distro) rejects the entire option line:
unknown option: subnet_mask, routers, broadcast, domain_name, domain_name_servers, domain_search, host_name, interface_mtu
so domain_name_servers, domain_name, domain_search, host_name and interface_mtu are never put in the Parameter Request List. A DHCP server that honours the PRL therefore omits option 6, and dhcpcd's 20-resolv.conf hook writes a resolv.conf with no nameservers.
Proof (run as root in the system distro, wsl --system -u root)
WSL's config, test mode (-T), OFFER has no DNS:
printf 'option subnet_mask, routers, broadcast, domain_name, domain_name_servers, domain_search, host_name, interface_mtu\nnoarp\ntimeout 30\n' > /tmp/w.conf
dhcpcd -T -4 -f /tmp/w.conf eth0
unknown option: subnet_mask, routers, broadcast, domain_name, domain_name_servers, domain_search, host_name, interface_mtu
eth0: offered 192.168.1.40 from 192.168.1.12
new_dhcp_server_identifier=192.168.1.12
new_ip_address=192.168.1.40
new_routers=192.168.1.12
Same config with broadcast -> broadcast_address, OFFER now carries DNS:
sed -i 's/broadcast,/broadcast_address,/' /tmp/w.conf
dhcpcd -T -4 -f /tmp/w.conf eth0
eth0: offered 192.168.1.40 from 192.168.1.12
new_domain_name_servers=192.168.1.12
new_domain_name_servers=192.168.1.12
...
The Windows host on the same vSwitch (ipconfig /all) receives DNS Servers: 192.168.1.12 from the same server, confirming the server is fine and the client request is what differs.
Fix
One-word change in src/linux/init/main.cpp (StartDhcpClient): broadcast -> broadcast_address. Patch attached / PR to follow.
Workarounds
Distro side: [network] generateResolvConf=false in /etc/wsl.conf and configure DNS statically (e.g. via systemd-resolved).
Server side (dnsmasq): dhcp-option-force=option:dns-server, so option 6 is sent even when not requested.