Ran into this issue when I had the hosts file open in vscode (insiders) to check if wsl2host.exe was working. If the hosts file is open in vscode, then the hostname (ubuntu.wsl) redirects the ip to an akamai technologies server that vscode talks to. but it only redirects the wsl2host hostname, not any manually set hostnames. and the ip in the hosts file doesn't change, it shows the correct wsl2 ip.
Ran into this issue when I had the hosts file open in vscode (insiders) to check if wsl2host.exe was working. If the hosts file is open in vscode, then the hostname (ubuntu.wsl) redirects the ip to an akamai technologies server that vscode talks to. but it only redirects the wsl2host hostname, not any manually set hostnames. and the ip in the hosts file doesn't change, it shows the correct wsl2 ip.