A
Alex Sinclair
Hi,
I'm trying to get the ip address of a website given its hostname. I'm
using the System.Net.Dns.GetHostByName(<hostname>)
using C# and ASP.NET.
This is not working reliably at all: for example. www.yahoo.com works just
fine, returning back the IP address, on the other hand, Google, MS, Sun, and
numerous others just return a Socket Exception:
"The requested name is valid and was found in the database, but it does not
have the correct associated data being resolved for"
Is there any other way to get the IP address of a website in a reliable
manner? why does this work using ping or tracert but doesn't work in
ASP.NET? (haven't checked using the Win32 API lately, but I have the feeling
it would work just fine).
Thanks,
Alex
I'm trying to get the ip address of a website given its hostname. I'm
using the System.Net.Dns.GetHostByName(<hostname>)
using C# and ASP.NET.
This is not working reliably at all: for example. www.yahoo.com works just
fine, returning back the IP address, on the other hand, Google, MS, Sun, and
numerous others just return a Socket Exception:
"The requested name is valid and was found in the database, but it does not
have the correct associated data being resolved for"
Is there any other way to get the IP address of a website in a reliable
manner? why does this work using ping or tracert but doesn't work in
ASP.NET? (haven't checked using the Win32 API lately, but I have the feeling
it would work just fine).
Thanks,
Alex