Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #7589

Re: dns_get_record() with timeout?

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 <sal@yojimbo.hack.invalid>
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 <k85lq2$1i4e$1@yojimbo.hack> (permalink)
References <agn2vbFtlrnU1@mid.individual.net>
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(<g$Wn^DpT{7eKh0{<lL>EW$KeqhJOTE>|hXg8<(oIo65&LEO&xAllp(o9t"
X-Reader-User hidden; display="24EEr1QzLVIfRpxx65/wVSkg68k"
Xref csiph.com comp.lang.php:7589

Show key headers only | View raw


On 2012-11-16, Simon <bad@example.com> 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++

Back to comp.lang.php | Previous | NextPrevious in thread | Find similar


Thread

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