FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » dns_get_record() with timeout?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
dns_get_record() with timeout? [message #179657] Fri, 16 November 2012 15:04 Go to previous message
Simon is currently offline  Simon
Messages: 29
Registered: February 2011
Karma:
Junior Member
Hi,

I have a cron job that runs in the background to check various urls
entered by users.

One of the job is to get the ip addresses of the urls given.

For that, the function dns_get_record(),
(http://php.net/manual/en/function.dns-get-record.php), works great.
I can get the IP addresses of the site, or even if the site is
'broken/unavailable', (or just garbage).

The only issue is that there does not really seem to be a way of adding
timeout to the function.

So in some cases, the functions waits for over 1 minute, if not longer,
(I have seen suggestions that the function should not wait more than 20
seconds).

Would anybody know of a fairly generic way of getting the IP addresses
of a site, (ipv4 and ipv6 when available), while protecting myself from
timeouts.

And, (maybe more importantly), does anybody know if it is possible for
the function dns_get_record( ... ) to never return?
Could an invalid domain/string cause the function to misbehave altogether?

Many thanks

Simon
[Message index]
 
Read Message
Read Message
Previous Topic: keeping the page content stay in their positions and not merging
Next Topic: why can`t close mysql_connect?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 13:25:26 GMT 2024

Total time taken to generate the page: 0.04865 seconds