S
Scot
I have the following code:
Dim IP, domainName As String
domainName = "yahoo.com"
Try
IP = System.Net.Dns.GetHostByName(domainName).AddressList(0).ToString()
Catch ex As Exception
IP = "Not Valid"
End Try
Console.WriteLine(IP)
System.Threading.Thread.Sleep(2000)
When it has a resolvable domain, like yahoo.com it responds back instantly
with the ip address. However, if there is a domain in there that does not
exist, like blue2343.com, it takes upwards of 5 seconds to print "Not Valid"
to the screen. Why is that? and is there a way around it?
Thanks,
Scott
Dim IP, domainName As String
domainName = "yahoo.com"
Try
IP = System.Net.Dns.GetHostByName(domainName).AddressList(0).ToString()
Catch ex As Exception
IP = "Not Valid"
End Try
Console.WriteLine(IP)
System.Threading.Thread.Sleep(2000)
When it has a resolvable domain, like yahoo.com it responds back instantly
with the ip address. However, if there is a domain in there that does not
exist, like blue2343.com, it takes upwards of 5 seconds to print "Not Valid"
to the screen. Why is that? and is there a way around it?
Thanks,
Scott