[RESOLVED] Resolving domain IP. Strange behavior.
Ok, I have a simple code to resolve IP address for a specified domain (please excuse the lack of error handling support, but this is a sample only):
VB Code:
Dim dns1 As Dns
Dim ips As IPHostEntry
ips = dns1.Resolve("something.com")
MsgBox(ips.AddressList(0).ToString)
Now, why is it that Internet explorer can resolve something.com and strange.com but that code returns and error indicating that the domain does not resolve?
Thanks!
Luc L.
Re: Resolving domain IP. Strange behavior.
Try adding "http://" to the name. IE has built in functionality to assume that's what you meant, but VB.Net relies on you a little more. May or may not work?
Re: Resolving domain IP. Strange behavior.
i did that. it returns a different error as well.
Re: Resolving domain IP. Strange behavior.
I got my IDE back, here's what I think you're after. (I was close :))
VB Code:
Dim ips As Net.IPHostEntry
ips = Net.Dns.Resolve("www.something.com")
MessageBox.Show(ips.AddressList(0).ToString)
Sorry for the delay, I still need to buy Visual Studio for home use.
Re: Resolving domain IP. Strange behavior.
thanks steven. that worked great!
Re: [RESOLVED] Resolving domain IP. Strange behavior.