I found the answer here:
Saturday 24 September 2022
WSL2 networking continues to be problematic, be it DNS not working or network connectivity being lost with the wider network. I also had an issue where WSL2 seemed to prefer a disconnected WiFi connection over a connected Ethernet one.
Things I have done:
1. Disable the unused WiFi Adaptor, this has prevented WSL2 from trying to use it.
2. Turned off Windows Fast Start - This is accessed from the power butttons options underneath power plan. Apparantly it helps fix issues if you shutdown\startup the machine with WSL2 rather than restart.
3. Configured static DNS for WSL2 machines. I created a /etc/wsl.conf file containing the following (replace the name servers with what you want):
generateResolvConf = false
4. Networking still craps out but I find this network stack reset recommendation from stackOverflow helps:
netsh winsock reset
netsh int ip reset all
netsh winhttp reset proxy
Windows Search > Network Reset