Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #7588
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Simon <bad@example.com> |
| Newsgroups | comp.lang.php |
| Subject | dns_get_record() with timeout? |
| Date | Fri, 16 Nov 2012 17:04:11 +0200 |
| Lines | 30 |
| Message-ID | <agn2vbFtlrnU1@mid.individual.net> (permalink) |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | individual.net TJOfWUNScPmZ04eWMYLkEQDK8JnbhzWDLJgcCMqheSlT3cVx3R1lzBDiLn/S9m1DB2 |
| Cancel-Lock | sha1:8pSDajzEbPCflNARnhJaEghvOw4= |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 |
| Xref | csiph.com comp.lang.php:7588 |
Show key headers only | View raw
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
Back to comp.lang.php | Previous | Next — Next in thread | Find similar
dns_get_record() with timeout? Simon <bad@example.com> - 2012-11-16 17:04 +0200 Re: dns_get_record() with timeout? Salvatore <sal@yojimbo.hack.invalid> - 2012-11-16 15:23 +0000
csiph-web