Windows App is unable to resolve DNS for IPv6 only endpoints.
Nat Gist
nat.gist at gmail.com
Tue Sep 1 20:53:07 UTC 2026
Problem description:
When using an ipv6 only endpoint the DNS resolution in windows app fails.
Steps to reproduce:
Using the windows app try to connect to an endpoint using it's
hostname where there is only an AAAA record and no A record.
Root Cause:
Trying to connect produces the following error
"Unable to resolve one or more DNS hostname endpoints: The requested
name is valid, but no data of the requested type was found."
The first half of the error message(before the : ) comes from ErrorDNSLookup
https://github.com/WireGuard/wireguard-windows/blob/4e6726c23ae9c5cb58e0c9910f3b7515621d133d/tunnel/service.go#L150
The second half(after the :) comes from WSANO_DATA documented here:
https://learn.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-getaddrinfow
Looking at the implementation of
resolveHostnameOnce(https://github.com/WireGuard/wireguard-windows/blob/4e6726c23ae9c5cb58e0c9910f3b7515621d133d/conf/dnsresolver_windows.go#L46)
The hints specify "Family: windows.AF_UNSPEC" which causes windows to
try and resolve both A and AAAA records, and it returns the error
WSANO_DATA when no IPv4 address is found. Somewhat oddly though not
too surprising the behavior for IPv4 only results seems to be no
error.
I'd suggest either querying each family separately and only failing
when both fail, or keep the existing AF_UNSPEC call and then doing a
subsequent AF_INET6 call if err WSANO_DATA is returned by the first
call to allow IPv6 only hosts to work.
Here's the redacted config I'm using for reference.
The endpoint only has an AAAA record. It doesn't have a public IPv4 address.
[Interface]
PrivateKey = [redacted]
Address = 10.10.10.3/32, fddd:28fa:bc9a::3/128
DNS = 192.168.10.1, fddd:28fa:bc9a::1
MTU = 1328
[Peer]
PublicKey = [redacted]
PresharedKey = [redacted]
AllowedIPs = 10.10.10.0/24, fddd:28fa:bc9a::/64, 192.168.10.0/24,
192.168.20.0/24, fda2:369:f8ec::/60, fda2:369:f8ec:10::/64
Endpoint = myhost.example.com:12345
More information about the WireGuard
mailing list