kennzors has asked for the wisdom of the Perl Monks concerning the following question:
hi
i'm having some difficulty in determining how to differentiate between gethostbyname() function call timing out, or not being able to find the host information at all.
I'm most interested in the time it takes to actually find the host information, or how long it takes to time out.
if i implement this for example:
$ipaddr = gethostbyname("www.thisisnotawebsite.com");
it takes no time at all for the dns server to return telling that the hostname is invalid.
From what I've tested, it takes around 20 seconds before the function returns undefined for $ipaddr. However, this difference isn't particularly accurate because it may be the case that it takes 20 seconds or more for the dns server to actually reply with the host information, or to return that the host is invalid.
anyone have a solution for this? If there needs to be clarification, i will clarify to the best of my ability!!
kennzors
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: gethostbyname timing out or dns server can't find the host information
by kennzors (Initiate) on Mar 11, 2013 at 23:10 UTC | |
|
Re: gethostbyname timing out or dns server can't find the host information
by Anonymous Monk on Mar 11, 2013 at 23:12 UTC | |
by Anonymous Monk on Mar 11, 2013 at 23:14 UTC | |
by kennzors (Initiate) on Mar 11, 2013 at 23:28 UTC | |
by Anonymous Monk on Mar 12, 2013 at 00:50 UTC |