Why does remote desktop not work for me by computer name, and only by IP?

10

2

I have a computer at work that I can only connect to remotely when using the computer's IP address and not when using the computer's name.

I can see my computer name is set up correctly as "JoshPC" (for example), and there don't appear to be any conflicts with other PCs names.

What could be going wrong? I've flushed the DNS cache on the PCs attempting to remote in but no luck.

Edit:

  • The PCs are on the same network as each other
  • I've tried ipconfig /registerdns and received no errors (although not waited 15 mins yet)
  • ping -a [IP] gives the right name
  • I've tried using the fully qualified computer name

Josh Comley

Posted 2009-10-07T08:06:37.573

Reputation: 3 582

Answers

10

I hope you are connecting from a machine in the same network and both are Windows. From the machine where you are remoting to JoshPC, What does ping -a <IPofJoshPC> give? Does it give a different computer name? If so then your DNS server is not updated with resource records of JoshPC. From JoshPC, try ipconfig /registerdns. It will take 15 mins or so to register that computers resource records with DNS.

Edit1: Saw you update. Interesting! After some waiting, if it still does not work, i suggest trying to access machine with FQDN if you have not tried it yet. I did not encounter this error inside office, but when i used VPN from home, i usually get this errors. Just giving computer name will not connect, but giving the Full-Qualified name will connect.

Edit2: If the above fails, try using nslookup for JoshPC and compare the IPs you get. If these are different, then your DNS is definitely not updated. Try contacting administrator or flushing and registering with DNS.

vpram86

Posted 2009-10-07T08:06:37.573

Reputation: 1 978

1+1 for useful tips and "ping -a [ip]" I didn't know about the "-a" switch to get the name! 1) it's on the same network - 2) "ping -a" gives the right name! - 3) "/registerdns" didn't help – Josh Comley – 2009-10-07T08:21:23.207

Did you wait for sometime :)? after registerdns? If it encountered errors, please check event viewer for any indications.Do you have some errors there? – vpram86 – 2009-10-07T08:22:46.887

@Aviator I've updated my question! – Josh Comley – 2009-10-07T08:26:37.253

Does ping -a give a name like JoshPC.domain.local and can you ping that fully qualified name? Also is it in a similar format to other machines that you can ping? Can anyone other computers access JoshPC by name? – sgmoore – 2009-10-07T08:31:39.910

@Aviator - good point about FQDN but that was actually one of the first things I tried. It didn't work, but the IP does. I'm so baffled as to why "ping -a" gives the right name!! It seems like the DNS is working one way but not the other. – Josh Comley – 2009-10-07T08:31:43.263

@sgmoore - the name it gives is not fully qualified, but it is in the same format as other machines that I am able to remote desktop to – Josh Comley – 2009-10-07T08:33:35.663

@joshcomley: Hmmm... Then next step might be to try nslookup. Do you know this command and how to use it? You can retreive details of JoshPC from DNS directly and see what it says, although it might be of little help only. – vpram86 – 2009-10-07T08:33:39.080

@Aviator - I suppose it might be interesting to compare the nslookup of a machine that works versus the one that doesn't, I'll have a go! – Josh Comley – 2009-10-07T08:35:31.040

@Aviator - aha! Something looks fishy: if I nslookup the FQDN of a PC that works it gets there all OK. If I nslookup the FQDN of the PC that doesn't work it gets there but with the wrong IP address. Using the IP address it gives I am (not surprisingly) unable to connect to the machine. – Josh Comley – 2009-10-07T08:39:10.347

@Joshcomley: Hmm :).. as expected, your DNS record is not updated. – vpram86 – 2009-10-07T08:42:49.233

@Joshcomley: I think 15 mins might have been over. Did you try now? – vpram86 – 2009-10-07T08:45:10.273

@Aviator - 15 minutes have been up, but no such luck. RD doesn't work and nslookup still returns the bad IP - I've tried /flushdns too but nothing! Actually, nslookup goes via one extra hop, what must be our DNS server. So that server is holding the wrong IP for my computer. I have access to that machine (our IT guy is away), so can I log in and fix this? – Josh Comley – 2009-10-07T08:55:54.883

@joshcomely::I never worked in DNS server. But i guess you can. You just need to flush the DNS server cache of your server (intermediate) – vpram86 – 2009-10-07T09:03:37.070

@joshcomely:I beleive it is dnscmd /clearcache – vpram86 – 2009-10-07T09:05:42.040

If your computer is part of a domain and you have permission to join it, then removing your computer from the domain and then joining the domain again should update the server dns. – sgmoore – 2009-10-07T09:17:55.743

2

This is related to RDP Security at the other end (Set to TLS or high) and using certificate from some internal CA

Nitish Kumar

Posted 2009-10-07T08:06:37.573

Reputation: 21

1

I've had this issue occasionally and it's been our experience so far that it might be linked to high CPU usage. If the CPU is being hammered, connecting through RDP becomes unreliable. Either we can't connect at all or we experience the same phenomenon of being able to connect with the IP, but not the host name. If we wait for the CPU to calm down, then it works more consistently.

I realize this is anectdotal, but I hope it helps.

Tim

Posted 2009-10-07T08:06:37.573

Reputation: 11

1

I ran into this same issue when I came across this page. On my machines, I noticed that pinging the host by its computer routes the ping outside of my home network to my ISP, but when I ping the client by its computer name (from the host) it finds it normally on the network.

Here is the output of pinging the host from the client by its computer name:

Pinging HOSTNAME.nyc.rr.com [67.215.65.XXX] with 32 bytes of data:
Reply from 67.215.65.XXX: bytes=32 time=14ms TTL=51
Reply from 67.215.65.XXX: bytes=32 time=34ms TTL=51
Reply from 67.215.65.XXX: bytes=32 time=14ms TTL=51
Reply from 67.215.65.XXX: bytes=32 time=12ms TTL=51

Ping statistics for 67.215.65.XXX:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 12ms, Maximum = 34ms, Average = 18ms

While pinging the client from the host by its computer name shows:

Pinging CLIENT [192.168.11.32] with 32 bytes of data:
Reply from 192.168.11.32: bytes=32 time=5ms TTL=128
Reply from 192.168.11.32: bytes=32 time=1ms TTL=128
Reply from 192.168.11.32: bytes=32 time=1ms TTL=128
Reply from 192.168.11.32: bytes=32 time=1ms TTL=128

Ping statistics for 192.168.11.32:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 5ms, Average = 2ms

Maybe someone has any more insight on this?

My router is running DD-WRT v24SP2-MULTI (11/20/11) std. I have not forwarded RDP ports because I only use remote desktop internally.

EDIT

It appears the issue had to do with the DhcpDomain registry key. For some reason it was set to nyc.rr.com on one computer and my business's domain on another even though both were my home computers. Setting them to blank fixed the issues I was having.

Edit DhcpDomain="" in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\\

Dave Haskel

Posted 2009-10-07T08:06:37.573

Reputation: 11

1

It seems that the DNS Server (the one holding the IP -> Name resolution) has cached wrong IP -> name pair. Ask your System Administrator to remove the entry & then try remoting.

Ganesh R.

Posted 2009-10-07T08:06:37.573

Reputation: 4 869