Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET2.0C#2.0
Hi,
 
I want to resolve the IP address from Hostname. I was previosuly using:
 
Dns.GetHostByAddress(Hostname);
 
Which is obsolete, So I tried:
 
Dns.GetHostEntry(Hostname);
 
Which couldn't resolve the IP Address. I am using Windows7 (32-bit)
 
Please Help..
Thanks in advance..
Posted 28-Nov-12 18:14pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
Vipin_Arora at 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)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Shai Vashdi 339
1 Sergey Alexandrovich Kryukov 285
2 OriginalGriff 280
3 Peter Leow 171
4 Abhinav S 168
0 Sergey Alexandrovich Kryukov 8,979
1 OriginalGriff 5,280
2 Peter Leow 4,010
3 Maciej Los 3,535
4 Abhinav S 3,263


Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 29 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid