The fact that the Server 2022 machine can ping www.google.com and successfully run Resolve-DnsName aka.ms and nslookup aka.ms only proves that DNS resolution and outbound network connectivity are working from the server. Those tests are not particularly relevant to the RDP problem. RDP is an inbound connection to TCP port 3389, so the important question is whether the client can reach the server on that port and whether Windows Firewall and the RDP service are allowing the connection.
On the Server 2022 machine, first verify that RDP is actually enabled and that the Remote Desktop Services service is running. Open PowerShell as Administrator and run:
Get-Service TermService
You should see Status as Running. If it is stopped, run:
Start-Service TermService
Then verify that the server is listening on TCP 3389:
Get-NetTCPConnection -LocalPort 3389 -State Listen
You should get a listening connection. You can also check with:
netstat -ano | findstr :3389
Next, verify that the Windows Firewall RDP rules are enabled:
Get-NetFirewallRule -DisplayGroup "Remote Desktop" | Select-Object DisplayName, Enabled, Profile
If they are disabled, enable them with:
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
The most useful test should be performed from the computer you are using to connect to the server, not from the server itself. From the RDP client, run:
Test-NetConnection SERVERNAME -Port 3389
or, if you are connecting by IP address:
Test-NetConnection SERVER-IP -Port 3389
If TcpTestSucceeded is False, you have a network/firewall/routing problem between the client and Server 2022. If it is True but RDP still fails, the problem is more likely authentication, RDP configuration, NLA, user permissions, or an RDP listener/service issue.
Also verify that the account you are using is permitted to log on through Remote Desktop. On the server, the user should either be an administrator or a member of the Remote Desktop Users group. You can check with:
net localgroup "Remote Desktop Users"
If this is a domain environment, also check whether a Group Policy is overriding the local RDP settings. Run:
gpresult /h C:\Temp\gpresult.html
and review the resulting policy report for Remote Desktop Services policies.
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin