Obtaining hostname from IP Address

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have an application where I monitor the status of a machine using it's IP
address. I would like to log an error when the machine goes down - but I want
to add the name of the machine along with the IP address in the log. Any
ideas how to achieve this? I have seen several examples of obtaining the IP
address given the host name using the dns.gethostbyname function but have not
seen anything that will work the other way.

Thanks in advance.

Ajay Mirmira
 
Tom,
I do not want the name of the local machine. I want the name of the remote
machine whose IP address I know. I used the function:

Dns.GetHostByAddress("207.46.156.220").HostName

to get the host name. It works fine with machines on the internet(returns
"origin2.microsoft.com"), but for machines on the intranet, it does not
always work. It prefixes funny characters before the machine name. At first I
was under the impression that the DNS entries are somehow messed up - but I
double verified with the system admin (and also verified for myself) that
this is not the case.

Any ideas?

Thanks.

Ajay Mirmira
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top