Click here to Skip to main content
15,063,166 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everybody,

How can i resolve url name (host address name) with the help of IP Address.

Such like as i have an ip : 209.85.231.104
and I want its host name means (www.google.com).



Thanks
Posted
Updated 25-Apr-21 20:55pm

You could try something like this;

VB
Dim entry As IPHostEntry = Dns.GetHostEntry("209.85.231.104")
Dim hostName As String = entry.HostName


Hope this helps,
Fredrik
   
Use this code
IPHostEntry IpEntry = Dns.GetHostByAddress(ip); 
 return iphostentry.HostName.ToString();


IP Address Host Name Converter[^]

Hope this might help you.
   
v2
you can edit the hosts file in this path: c:\WINDOWS\system32\drivers\etc\hosts
by adding "209.58.231.104 www.google.com"
but this only works for the local network (LAN)
   
Comments
[no name] 24-Feb-11 2:40am
   
Dear Sir,

The question is : i have an IP (209.85.231.104). It is ip of a website. Now how can i get the website name by using programming.


Thanks

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