Matching an IP address to a hostname when both are available but cannot be resolved

hostnameipnetstatwindows-server-2008-r2

I am an administrator on a server that accepts RDP connections. When the client connects I know the client's computer name. Using netstat I can determine which connections have been established for RDP.

The ping command and variants only work if I ping by IP address; however, the command will not return a hostname. If I ping by hostname the command will always fail. The nslookup command always fails on both the hostname and the IP address. The nbstat command is not available on the machine.

Question
If I have both he hostname and the IP address how do I match them to each other?

Command line tools, programming solutions in C# or a combination of both are all viable options.

Best Answer

Identify the DNS server being used by nslookup. If you or your company own / operate the DNS server you can add the host names and IP addresses required.

If you are not in control of DNS, the best solution would be to setup your own local DNS server and add each host.

A quick but dirty solution would be to add each host to the servers hosts file.

Checking hosts file / common windows DNS issues: relevant technet link