locked
How to get computer name which is in another domain or network RRS feed

  • Question

  • User-330985113 posted
    Hi, I have a computer (MyPc) in "ABC" domain and my webserver is in "XYZ" domain at the same time both are having a different DNS. Now i need to get the hostname of my computer which is in "ABC" domain when i am sending request from "XYZ" network. I have used the below codes but it is giving IP address of the computer instead of hostname. IPHostEntry host; IPAddress address = IPAddress.Parse(ipaddr); host = Dns.GetHostEntry(address); Console.WriteLine(host.HostName.ToString()); string[] computer_name = System.Net.Dns.GetHostEntry(Request.ServerVariables["remote_host"]).HostName.Split(new Char[] { '.' }); string clientPCName = System.Net.Dns.GetHostEntry(Request.UserHostAddress).HostName.ToString(); Please help me with the code to queries the DNS of the client, not the Server.
    Tuesday, August 27, 2013 1:01 AM

Answers

  • User1508394307 posted

    In this case I think this is a subject of dns configuration rather than .net. Check it with your network administrator.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 27, 2013 5:19 PM

All replies

  • User1508394307 posted

    If you perform from command prompt nslookup <xxx> or ping -a <xxx>, do you get that name?

    Tuesday, August 27, 2013 2:10 AM
  • User-330985113 posted
    Hello, Thanks for the reply. No. I am not getting the hostname when i perform nslookup or ping from my webserver
    Tuesday, August 27, 2013 2:22 AM
  • User1508394307 posted

    In this case I think this is a subject of dns configuration rather than .net. Check it with your network administrator.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 27, 2013 5:19 PM