Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

Please help me how to get remote computer IPaddress/Hostname.I tried with system.dns.gethostname and gethostentry but all are returning only local machine addreess.
So please help me to get below info.
How to get remote computer IPaddress/Hostname by accepting either on the one as Input parametes?

I need info like the below methods

1.
GetRemoteHostAdress(string IPaddress)
 { 
return hostname , FullyQualified machine name 
 } 


2.
GetRemoteIPAdress(string HostName){ 
return Ipaddress , Fully Qualified MAchine Name 
} 


I request every one to help me.

Thanks
Posted
Updated 18-Jul-10 18:21pm
v2

See this thread[^].
 
Share this answer
 
Those functions are returning the names/IP's that are registered in whatever DNS your app is querying, which is probably only going to be the local LAN address. If you're trying to get an external IP address that your ISP has assign to your network/router/modem/whatever, then you have to use an external web site to provide that IP for you, like http://whatismyipaddress.com/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900