Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!yojimbo.hack!news.tokachu.com!.POSTED!not-for-mail From: Salvatore Newsgroups: comp.lang.php Subject: Re: dns_get_record() with timeout? Date: Fri, 16 Nov 2012 15:23:46 +0000 (UTC) Organization: Yojimbo NNTP server Lines: 16 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: yojimbo.hack "kq(Iga%czn" X-Complaints-To: usenet(at)tokachu(dot)com User-Agent: slrn/0.9.9p1 (FreeBSD) X-Watermark: "Q(EW$KeqhJOTE>|hXg8<(oIo65&LEO&xAllp(o9t" X-Reader-User: hidden; display="24EEr1QzLVIfRpxx65/wVSkg68k" Xref: csiph.com comp.lang.php:7589 On 2012-11-16, Simon wrote: > 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. You have to write your own function that will build a UDP packet to query a DNS server, call the socket_set_timeout() function to set a timeout value, send the UDP packet, and hope that you get a response. An example of how you can do this is located at php.net: http://www.php.net/manual/en/function.gethostbyaddr.php#46869 -- Blah blah bleh... GCS/CM d(-)@>-- s+:- !a C++$ UBL++++$ L+$ W+++$ w M++ Y++ b++