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

I want to resolve the IP address from Hostname. I was previosuly using:

Dns.GetHostByAddress(Hostname);


Which is obsolete, So I tried:

C#
Dns.GetHostEntry(Hostname);


Which couldn't resolve the IP Address. I am using Windows7 (32-bit)

Please Help..
Thanks in advance..
Posted

1 solution

The first thing to try in such a situation is: can you get the the IP address from the hostname using other tools? The simplest thing is executing a ping.
Likely, your DNS is not configured correctly.
 
Share this answer
 
Comments
Vipin_Arora 29-Nov-12 22:50pm    
Yes, It is pinging perfectly.
Also Ipconfig on this machine showing IP address correctly, the same I am getting from the command:GetHostByAddress

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