Can ping by hostname, can RDP by IP, but cannot RDP by hostname?

0

I'm trying to Remote Desktop to another Windows PC. Both computers are in the same WORKGROUP. I can ping the remote computer by its hostname, which responds with its IPv4 address. I could get that work after running Prefer IPv4 over IPv6 in prefix policies EasyFix from Microsoft. Before running the EasyFix, pinging remote host responded with IPv6.

I can also connect with Remote Desktop Connection using IPv4 and it works, however, trying to Remote Desktop with hostname gives me this error:

Remote Desktop can't find the computer "OTHERWINPC". This might mean that "OTHERWINPC" does not belong to the specified network. Verify the computer name and domain that you are trying to connect to.

What can be the issue?

orad

Posted 2018-07-24T05:54:40.153

Reputation: 289

Guess: The remote computer also has an IPv6 address, and that IPv6 address isn't reachable? And remote desktop prefers IPv6 over IPv4, even with the prefix policy? – dirkt – 2018-07-24T06:54:30.863

@dirkt That's correct. Remote computer is not reachable by IPv6, and apparently RDP prefers IPv6 over IPv4. – orad – 2018-07-24T07:23:00.643

So the simplest fix would be to make it look like the remote computer only has an IPv4 address, for example by using a slightly different name, and entering it in the hosts file (if it has a static address). Or any other solution depending on how you've setup your local DNS. – dirkt – 2018-07-24T08:11:13.043

Or fix whatever problem has broken IPv6 connectivity. – Michael Hampton – 2018-07-24T13:59:10.673

Answers

1

Answering myself: The fix was something really weird. First I made sure that both local computer and remote computer prefer IPv6 over IPv4 using the EasyFix. Then I noticed I could not ping the remote computer when I use all caps for hostname. I got:

Ping request could not find host MYHOME-PC. Please check the name and try again.

but could ping with any other casing like ping myhome-pc or ping MyHome-PC that came back with IPv6. I used all lowercase hostname to connect with remote desktop and that worked!

orad

Posted 2018-07-24T05:54:40.153

Reputation: 289

2That's a little strange. Hostnames are not case sensitive. So it shouldn't matter if you have caps lock on or not. I wonder what's going on there. – Michael Hampton – 2018-08-04T13:44:46.330

0

In your situation, when you used RDP the hostname, it should have returned the ipv6 address, so that you RDP failed.

You can use this workaround, add a CNAME(alias) DNS record of the ipv4 for the target PC in the DNS server. And then use the CNAME to RDP the target PC.

OOOO

Posted 2018-07-24T05:54:40.153

Reputation: 942

0

Try adding "\\" to the beginning of the computer name

For your "OTHERWINPC" example, try "\\OTHERWINPC" instead.

At least this is what worked for me. I only started encountering this error earlier this year. In light of the other comments here, perhaps it was due to some sort of IPv6 change in some upgrade. And maybe "\\" ends up forcing IPv4.

MotohawkSF

Posted 2018-07-24T05:54:40.153

Reputation: 101

-1

Disabling IPv6 on this server 2012 box fixed the issue for me. Thanks.

Joel Rodriguez

Posted 2018-07-24T05:54:40.153

Reputation: 1